vbpupil/uk-postcode-validation

1.0 2019-02-11 12:12 UTC

This package is auto-updated.

Last update: 2024-05-12 04:13:06 UTC


README

PHP 5.6 Build Status License: MIT

UK Postcode Validation

UK postcode validation tool used to determine that a string given is a valid UK Postcode. The object then returned contains the following:

  1. Type - area classification
  2. Head - first section of the postcode
  3. Tail - last section of the postcode

How to use?

$p = new Postode('SW1A 1AA');
$p->getType(); # returns string UK_MAINLAND
$p->getHead(); # returns string SW1A
$p->getTail(); # returns string 1AA