PHP code example of vladshut / postcode-bundle
1. Go to this page and download the library: Download vladshut/postcode-bundle 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/ */
vladshut / postcode-bundle example snippets
php
// app/AppKernel.php
public function registerBundles()
{
$bundles = array(
// ...
new Usoft\PostcodeBundle\UsoftPostcodeBundle(),
);
}
php
$address = $this->get('usoft.postcode.client')->getAddress('1012JS', 1);
$address->getStreet(); // Dam
$address->getCity(); // Amsterdam
$address->getMunicipality(); // Amsterdam
$address->getProvince(); // Noord-Holland
$address->getNumber(); // 1
$address->getZipcode(); // 1012JS
$address->getGeoLocation(); // array('latitude' => 52.3732926, 'longitude' => 4.8937176)