Skip to content

vbpupil/uk-postcode-validation

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Quality Assurance

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