PHP code example of varsitynewsnetwork / google-places-api
1. Go to this page and download the library: Download varsitynewsnetwork/google-places-api library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
varsitynewsnetwork / google-places-api example snippets
$service = new PlaceService(new GuzzleAdapter());
$service->setApiKey('YOUR_KEY_HERE');
$results = $service->textSearch('Van Andel Arena', function (results) {
if (count($results)) {
return $results[0]['formatted_address'];
}
return null;
});
$service = new PlaceService(new GuzzleAdapter());
$service->setApiKey('YOUR_KEY_HERE');
$result = $service->textSearch('Van Andel Arena', new CompositeFormatter([
new SingleResultFormatter(),
new CountryStripperFormatter(true),
new LatLngFormatter(true)
]));
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.