I need one help.I need to get the json decode value inside foreach loop using PHP. I am explaining my code below.
$user_qry = "http://oditek.in/takeme/webservice/user2/user_ride_list_v2.php";
$pstflds="mobile=".$mobile;
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $user_qry);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $pstflds);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$response=curl_exec ($ch);
$data=json_decode($response,true);
$bikeArr=$data->data;
print_r($bikeArr);exit;
Its giving the output like below.
Array ( [0] => stdClass Object ( [book_id] => 161117193881 [booking_status] => 4 [book_date] => 17-11-2016 [book_time] => 07:38 PM ) [1] => stdClass Object ( [book_id] => 161116183564 [booking_status] => 4 [book_date] => 16-11-2016 [book_time] => 06:35 PM ) )
I need to iterate the above array in foreach loop and get the data.Please help me.