PHP code example of vbpupil / uk-postcode-validation
1. Go to this page and download the library: Download vbpupil/uk-postcode-validation 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/ */
vbpupil / uk-postcode-validation example snippets
$p = new Postode('SW1A 1AA');
$p->getType(); # returns string UK_MAINLAND
$p->getHead(); # returns string SW1A
$p->getTail(); # returns string 1AA