status == 'OK'){ $latitude = $output->results[0]->geometry->location->lat; //Returns Latitude $longitude = $output->results[0]->geometry->location->lng; // Returns Longitude $location = $output->results[0]->formatted_address; } $coords['lat'] = $latitude; $coords['long'] = $longitude; /* $url = sprintf('http://maps.google.com/maps?output=js&q=%s',rawurlencode($address)); $result = false; if($result = file_get_contents($url)) { $coords = array(); if(strpos($result,'errortips') > 1 || strpos($result,'Did you mean:') !== false) { return false; } preg_match('!center:\s*{lat:\s*(-?\d+\.\d+),lng:\s*(-?\d+\.\d+)}!U', $result, $matches); $coords['lat'] = $matches[1]; $coords['long'] = $matches[2]; } */ echo ' '; } ?>