PHP code example of phpfacile / geocoding-db-zend

1. Go to this page and download the library: Download phpfacile/geocoding-db-zend 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/ */

    

phpfacile / geocoding-db-zend example snippets


$config = [
    'driver' => 'Pdo_Sqlite',
    'database' => 'my_database.sqlite',
];
$adapter = new Zend\Db\Adapter\Adapter($config);

$config = [
    'driver' => 'Pdo_Mysql',
    'host' => 'localhost'
    'dbname' => 'my_database',
    'user' => 'my_username',
    'password' => 'my_password',
];
$adapter = new Zend\Db\Adapter\Adapter($config);

use PHPFacile\Geocoding\Db\Service\LocationService;

$locationService = new LocationService($adapter);

$id = $locationService->getIdOfStdClassLocationAfterInsertIfNeeded($location)