PHP code example of ici-brussels / urbis-php
1. Go to this page and download the library: Download ici-brussels/urbis-php 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/ */
ici-brussels / urbis-php example snippets
$urbis = new Urbis_Geoloc();
// Find relevant address according to input
/* Option 1: Structured */
$urbis->getAddress_Structured("rue américaine", "25", "1060", "fr");
/* Option 2: Unstructured */
$urbis->getAddress_Unstructured("rue américaine 25", "fr");
// get array with validated address
$result = $urbis->getStructuredAddress();
print_r($result);
/*
Array
(
[StreetName] => Rue Américaine
[StreetNumber] => 25
[PostalCode] => 1060
[MunicipalityName] => Saint-Gilles
)
*/
// get array with latitude/longitude
$result = $urbis->getGeographicalLocation();
print_r($result);
/*
Array
(
[lat] => 50.824197276153
[lon] => 4.3554360355926
)
*/