I am sending data from my local machine to the server using CURL . And the data is a multidimensional array.
Array ( [0] => stdClass Object ( [id] => 1 ) [1] => stdClass Object ( [id] => 0 ) [2] => stdClass Object ( [id] => 11 ) )
I use this code below to send data.
$ch = curl_init(); curl_setopt($ch, CURLOPT_HEADER, 0); curl_setopt($ch, CURLOPT_VERBOSE, 0); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_URL, "my_url"); curl_setopt($ch, CURLOPT_POST, true); curl_setopt($ch, CURLOPT_POSTFIELDS, $array); // $array is my above data
But on the server, when I try to put this input into a file or just print_r , it gives me this output below
Array ( [0] => Array [1] => Array [2] => Array )
But I want the result to be multidimensional.
I tried with print_r($_POST[0]) , but it gives only Array text.
Yogesh suthar
source share