Thanks to both of you for your help.
Weed, I think the unmatched results between the function and page links stems from the results being different from v2 to v3 of the Google Maps API. The function I was using up to today was found on the web, as I am not savvy enough to figure out the process on my own. Now I'm trying to write the function to handle the json result I posted above.
Is handling it as an associative array better than as an object? I am only using this method because it's what I found on the web in regards to json parsing tutorials. Should I change that?
Sneaky, thank you very much for the assistance on properly handling the result. I've modified what I've got to check against empty or false $json result:
function getGeolocation($address){
$address = urlencode($address);
$url = "http://maps.google.com/maps/api/geocode/json?sensor=false" .
"&address=" . urlencode($address);
$json = file_get_contents($url);
if($json == '' or $json == 'FALSE'){
// Not a valid result. We need to step up like real men and handle it.
}else{
$data = json_decode($json, TRUE);
return $data['results'];
}
}
I think the next part I need to check against is that status == "OK"(you can see that at the bottom of the json URL) before going any further and recording status if it isn't "OK". Is there anything you would think I need to check before doing this?
Thanks again for everything!