public function geocode($address)
    {
        $gecode = $this->_url.'address='.urlencode($address);

        if($this->_key){
            $gecode .= '&key='.$this->_key;
        }

        $data = json_decode(file_get_contents($gecode),true);

        $this->_status = $data['status'];

        if ($this->_status === 'OK') {
            $results = $data['results'][0]['geometry']['location'];
            $location = array(
                'longitude' => $results['lng'],
                'latitude' => $results['lat'],
                'results' => $data['results'],
            );

            return $location;
        } else {
            return false;
        }
    }
public function geocode($address)
    {
        $gecode = $this->_url.'address='.urlencode($address);

        if($this->_key){
            $gecode .= '&key='.$this->_key;
        }

        $data = json_decode(file_get_contents($gecode),true);

        $this->_status = $data['status'];

        if ($this->_status === 'OK') {
            $results = $data['results'][0]['geometry']['location'];
            $location = array(
                'longitude' => $results['lng'],
                'latitude' => $results['lat'],
                'results' => $data['results'],
            );

            return $location;
        } else {
            return false;
        }
    }
public function geocode ( $ address ) { $ gecode = $ this -> _url . 'address=' . urlencode ( $ address ) ; if ( $ this -> _key ) { $ gecode .= '&key=' . $ this -> _key ; } $ data = json_decode ( file_get_contents ( $ gecode ) , true ) ; $ this -> _status = $ data [ 'status' ] ; if ( $ this -> _status === 'OK' ) { $ results = $ data [ 'results' ] [ 0 ] [ 'geometry' ] [ 'location' ] ; $ location = array ( 'longitude' => $ results [ 'lng' ] , 'latitude' => $ results [ 'lat' ] , 'results' => $ data [ 'results' ] , ) ; return $ location ; } else { return false ; } }
obtains longitude and latitude values given an address

@param string "address, city, state_province, country, zip_postalcode"
@return array(long, lat) or else false
obtains longitude and latitude values given an address