PHP Class KamranAhmed\Geocode\Geocode

Author: Kamran Ahmed ([email protected])
Show file Open project: kamranahmedse/php-geocode

Public Methods

Method Description
__construct ( string $key = '' ) Constructor
get ( $address ) : boolean | object Sends request to the passed Google Geocode API URL and fetches the address details and returns them
getServiceUrl ( ) : string Returns the private $serviceUrl

Method Details

__construct() public method

Constructor
public __construct ( string $key = '' )
$key string Google Maps Geocoding API key

get() public method

Sends request to the passed Google Geocode API URL and fetches the address details and returns them
public get ( $address ) : boolean | object
$address
return boolean | object false if no data is returned by URL and the detail otherwise

getServiceUrl() public method

Returns the private $serviceUrl
public getServiceUrl ( ) : string
return string The service URL