2017 © Pedro PelĆ”ez
 

library poczta-polska-ranges

Parse ranges provided by Poczta Polska in their PNA list

image

nassau/poczta-polska-ranges

Parse ranges provided by Poczta Polska in their PNA list

  • Tuesday, May 23, 2017
  • by mlebkowski
  • Repository
  • 1 Watchers
  • 1 Stars
  • 5,685 Installations
  • PHP
  • 1 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 3 Versions
  • 9 % Grown

The README.md

Parse ranges provided by Poczta Polska in their PNA list

Installation

composer require nassau/poczta-polska-ranges

Usage

TL;DR;, (*1)

(new Nassau\PocztaPolskaRanges\RangeChecker)->isInRanges("15a", "10-24(p)");
// false, 15a is on the other side of the street

Poczta polska provides zip codes (PNA) with building number ranges in format:, (*2)

An-Bm, X-Z(p)

This tool parses those formats and checks if given number matches given range, for example:, (*3)

$data = [
    'Piękna' => [
        '00-549' => '11-29(n), 18-26(p)',
        '00-477' => '1-1a, 10',
        '00-539' => '1b-9(n), 12-16b(p)',
        '00-547' => '28-42(p)',
        '00-482' => '2-8(p)',
        '00-677' => '31-39(n)',
        '00-672' => '41-DK(n), 44-68a(p)',
    ]
];

$input = 'Piękna 8';

list ($street, $number) = explode(" ", $input);

$checker = new RangeChecker;

foreach ($data[$street] as $code => $ranges) {
    if ($checker->isInRanges($number, $ranges)) {
        echo "ā€ž${input}ā€ matches $code zip code\n";
    }
}

The Versions

23/05 2017

dev-master

9999999-dev

Parse ranges provided by Poczta Polska in their PNA list

  Sources   Download

MIT

The Development Requires

23/05 2017

1.0.1

1.0.1.0

Parse ranges provided by Poczta Polska in their PNA list

  Sources   Download

MIT

The Development Requires

10/08 2016

1.0

1.0.0.0

Parse ranges provided by Poczta Polska in their PNA list

  Sources   Download

MIT

The Development Requires