Quick PHP script tp retrieve nested values in a JSON string.
Budget: $10 – $30 USD
I need a quick PHP script that will retrieve the following nested information from the URL below.
"VehicleHasMandatoryRectificationNotice": true,
"VehicleHasVoluntaryServiceRectification": false,
"YearOfManufacture": "2010",
"Make": "MERCEDES-BENZ",
"Colour": "SILVER",
https://uk1.ukvehicledata.co.uk/api/datapackage/VehicleDataWithEmissions?v=2&api_nullitems=1&auth_apikey=87d3f786-ed08-4ab9-bdb6-52fb11e7418e&user_tag=&key_VRM=LA60FKU
//this sample works but obviously only at the root of the JSON,... I need it extended to loop into the nested values. It should take 10 minutes for someone who has experience decoding JSON.
$url = file_get_contents("https://uk1.ukvehicledata.co.uk/api/datapackage/VehicleDataWithEmissions?v=2&api_nullitems=1&auth_apikey=87d3f786-ed08-4ab9-bdb6-52fb11e7418e&user_tag=&key_VRM=LA60FKU");
$decoded_json = json_decode($url, true);
$Response = $decoded_json['Response'];
echo $Response['StatusCode'];
"VehicleHasMandatoryRectificationNotice": true,
"VehicleHasVoluntaryServiceRectification": false,
"YearOfManufacture": "2010",
"Make": "MERCEDES-BENZ",
"Colour": "SILVER",
https://uk1.ukvehicledata.co.uk/api/datapackage/VehicleDataWithEmissions?v=2&api_nullitems=1&auth_apikey=87d3f786-ed08-4ab9-bdb6-52fb11e7418e&user_tag=&key_VRM=LA60FKU
//this sample works but obviously only at the root of the JSON,... I need it extended to loop into the nested values. It should take 10 minutes for someone who has experience decoding JSON.
$url = file_get_contents("https://uk1.ukvehicledata.co.uk/api/datapackage/VehicleDataWithEmissions?v=2&api_nullitems=1&auth_apikey=87d3f786-ed08-4ab9-bdb6-52fb11e7418e&user_tag=&key_VRM=LA60FKU");
$decoded_json = json_decode($url, true);
$Response = $decoded_json['Response'];
echo $Response['StatusCode'];