I am trying to decode json and then break the value with foreach loop. Here is my script.
<?php $new_data=json_decode($pay_data->l1_level,true);
print_r($new_data);
?>
this print return array.
Array ( [name] => Array ( [0] => sanjay [1] => susanchen [2] => mabelzhen) [product-price] => Array ( [0] => 250 [1] => 250 [2] => 250) )
I am trying to break this foreach loop and get name and price value . I am trying to this away
foreach($new_data as $value){
echo $value->name;
echo $value->product_price ;
}
But This is not working.Any Help will be Appreciate.