I'm using the Google Map API V3 sending it the Lat/Lng and it returns the full address. I'm parsing the address that's returned by using the Object. It works for many addresses but for some of them it is generating the PHP error of about the property being a non-object:
PHP Notice: Trying to get property of non-object in get5.php on line 47
PHP Notice: Trying to get property of non-object in get5.php on line 48
PHP Notice: Trying to get property of non-object in get5.php on line 49
Here are the lines of code for 47-49:
$city_google_api = $country->AdministrativeArea->Locality->LocalityName;
$state_google_api = $country->AdministrativeArea->AdministrativeAreaName;
$zip_code_google_api = $country->AdministrativeArea->Locality->PostalCode->PostalCodeNumber;
I would like to debug this further, but I don't know which record this is causing these messages regarding the property of non-object. Is there a way to trap on the error or check for "property of non-object" so that I can dump the variables? I don't want to dump this for each record because that's too much output. In general, I would like to know if there is a way to trap errors to dump variables? Thanks!