I want to submit arrays to cURL
<form action="post.php" method="post">
<input name="comment[]" value="oh"/><br>
<input name="comment[]" value="wow"/><br>
<input name="comment[]" value="like"/><br>
<input type="submit" />
</form>
and I want the result send to curl like this:
curl_setopt ($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt ($ch, CURLOPT_POST, 1);
curl_setopt ($ch, CURLOPT_POSTFIELDS, "0=oh&1=wow&2=like");
$hasil = curl_exec ($ch);
curl_close ($ch);
post.php file:
$inputs = $_POST['comment']; print_r($inputs);
and result:
Array
(
[0] => oh
[1] => wow
[2] => like
)
How can I send the result to cURL?