Currently trying this:
unset($jsonArr-[$json]);
but I get this error: Parse error: syntax error, unexpected '-', expecting ',' or ')'
This has to be simple to do. I've been searching for an answer to this for hours. I think I've tried everything listed on this site. I'm pulling lat
and lng
from mapquest and I need to clear the array to do the next record.
$json = file_get_contents('http://www.mapquestapi.com/geocoding/v1/address?key=MYKEY&Format=json&inFormat=json&json={location:{street:%22$address%22},options:{thumbMaps:false,maxResults:1}}');
$jsonArr = json_decode($json);
$lat = $jsonArr->results[0]->locations[0]->latLng->lat;
$lon = $jsonArr->results[0]->locations[0]->latLng->lng;
Any help would be greatly appreciated.
UPDATE - Totally not the array not clearing, it was the variable in the address.