PHP code example of optiosteam / belgian-region-zip

1. Go to this page and download the library: Download optiosteam/belgian-region-zip 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/ */

    

optiosteam / belgian-region-zip example snippets


echo '<pre>';
var_dump(BelgianRegionZipHelper::getMunicipalitiesByZipCode(1000));
echo '</pre>';

echo '<pre>';
var_dump(BelgianRegionZipHelper::getMunicipalitiesByZipCode(8000, 'BE-Vwv', 'nl'));
echo '</pre>';

echo '<pre>';
var_dump(BelgianRegionZipHelper::getZipCodesByRegionIsoCode('BE-BRU'));
echo '</pre>';

array(2) {
  'nl' =>
  array(1) {
    [0] =>
    string(7) "Brussel"
  }
  'fr' =>
  array(1) {
    [0] =>
    string(9) "Bruxelles"
  }
}

array(22) {
  [0] =>
  int(1000)
  [1] =>
  int(1020)
  [2] =>
  int(1030)
  [3] =>
  int(1040)
  [4] =>
  int(1050)
  [5] =>
  int(1060)
  [6] =>
  int(1070)
  [7] =>
  int(1080)
  [8] =>
  int(1081)
  [9] =>
  int(1082)
  [10] =>
  int(1083)
  [11] =>
  int(1090)
  [12] =>
  int(1120)
  [13] =>
  int(1130)
  [14] =>
  int(1140)
  [15] =>
  int(1150)
  [16] =>
  int(1160)
  [17] =>
  int(1170)
  [18] =>
  int(1180)
  [19] =>
  int(1190)
  [20] =>
  int(1200)
  [21] =>
  int(1210)
}