I Need to push in a array all the values of "total_value" and all the values of "car_id" that came form a json url.
Json:
[
{
"control": {
"color": "blue",
"total_value": 21.5,
"car_id": 421118
}
},
{
"control": {
"color": "green",
"total_value": 25,
"car_id": 421119
},
{
"control": {
"color": "red",
"total_value": 18,
"car_id": 421519
}
}
]
My Php:
<?php
$getJson = file_get_contents("http://url.com/control.json",false);
$j = json_decode($getJson);
$j = json_decode($getJson,true);(add true as second value) help?