1. Go to this page and download the library: Download altrozero/postcode-uk 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/ */
altrozero / postcode-uk example snippets
$postcode = new Postcode('SR5 1NA');
$postcode->get(); // SR51NA
$postcode->getOutward(); //SR5
$postcode->getInward(); // 1NA
$postcode->getArea(); // SR
$postcode->getDistrict(); // 5
$postcode->getSector(); // 1
$postcode->getUnit(); // NA