https://github.com/vbpupil/uk-postcode-validation
UK Postcode Validation
https://github.com/vbpupil/uk-postcode-validation
postcode postcode-validation postcodes validation
Last synced: 19 days ago
JSON representation
UK Postcode Validation
- Host: GitHub
- URL: https://github.com/vbpupil/uk-postcode-validation
- Owner: vbpupil
- License: mit
- Created: 2019-01-18T10:11:31.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2019-02-11T12:14:13.000Z (about 7 years ago)
- Last Synced: 2025-12-15T02:30:32.193Z (4 months ago)
- Topics: postcode, postcode-validation, postcodes, validation
- Language: PHP
- Homepage:
- Size: 25.4 KB
- Stars: 3
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
## Quality Assurance

[](https://travis-ci.org/vbpupil/uk-postcode-validation)
[](https://opensource.org/licenses/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?
```php
$p = new Postode('SW1A 1AA');
$p->getType(); # returns string UK_MAINLAND
$p->getHead(); # returns string SW1A
$p->getTail(); # returns string 1AA
```