rossriley / postcodelib
Perform simple analysis and validation on UK postcodes
Installs: 24
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
Open Issues: 0
pkg:composer/rossriley/postcodelib
This package is not auto-updated.
Last update: 2025-09-28 00:23:59 UTC
README
This simple class ensure that a postcode is valid along with some helper methods to ease formatting.
Usage
use Postcodelib\Postcode;
$postcode = new Postcode('B55SE');
$postcode->valid(); // returns true
$postcode->postcode(); // returns a normalised string: B5 5SE
$postcode->prefix(); // returns B5
$postcode->suffix(); // returns 5SE