PHPackages                             vbpupil/uk-postcode-validation - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Validation &amp; Sanitization](/categories/validation)
4. /
5. vbpupil/uk-postcode-validation

ActiveLibrary[Validation &amp; Sanitization](/categories/validation)

vbpupil/uk-postcode-validation
==============================

UK Postcode Validation

1.0(7y ago)31091MITPHPPHP &gt;=5.6

Since Feb 11Pushed 7y ago1 watchersCompare

[ Source](https://github.com/vbpupil/uk-postcode-validation)[ Packagist](https://packagist.org/packages/vbpupil/uk-postcode-validation)[ Docs](https://github.com/vbpupil/postcodeValidation)[ RSS](/packages/vbpupil-uk-postcode-validation/feed)WikiDiscussions master Synced today

READMEChangelog (1)Dependencies (1)Versions (2)Used By (0)

Quality Assurance
-----------------

[](#quality-assurance)

[![PHP 5.6](https://camo.githubusercontent.com/88093c79af42bd3c07f4d6aa378289e1f5450411c56753b0323bd7d8b9b1f9ee/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f5048502d352e362d626c75652e737667)](https://camo.githubusercontent.com/88093c79af42bd3c07f4d6aa378289e1f5450411c56753b0323bd7d8b9b1f9ee/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f5048502d352e362d626c75652e737667)[![Build Status](https://camo.githubusercontent.com/42d54be97c7a77d5c165d4bb19e6fdec287656cc50f3ff90dabec6a90848f63d/68747470733a2f2f7472617669732d63692e6f72672f7662707570696c2f756b2d706f7374636f64652d76616c69646174696f6e2e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/vbpupil/uk-postcode-validation)[![License: MIT](https://camo.githubusercontent.com/784362b26e4b3546254f1893e778ba64616e362bd6ac791991d2c9e880a3a64e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4c6963656e73652d4d49542d677265656e2e737667)](https://opensource.org/licenses/MIT)

UK Postcode Validation
======================

[](#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?

[](#how-to-use)

```
$p = new Postode('SW1A 1AA');
$p->getType(); # returns string UK_MAINLAND
$p->getHead(); # returns string SW1A
$p->getTail(); # returns string 1AA
```

###  Health Score

27

—

LowBetter than 49% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity14

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity55

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

2644d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/afdce7c1b24b3c017b5381c2708b9dd27b9b694de9b09b49ee500a26d3f46364?d=identicon)[vbpupil](/maintainers/vbpupil)

---

Top Contributors

[![vbpupil](https://avatars.githubusercontent.com/u/2638990?v=4)](https://github.com/vbpupil "vbpupil (4 commits)")

---

Tags

postcodepostcode-validationpostcodesvalidationpostcodepostcodespostcode-validation

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/vbpupil-uk-postcode-validation/health.svg)

```
[![Health](https://phpackages.com/badges/vbpupil-uk-postcode-validation/health.svg)](https://phpackages.com/packages/vbpupil-uk-postcode-validation)
```

###  Alternatives

[webmozart/assert

Assertions to validate method input/output with nice error messages.

7.6k894.0M1.2k](/packages/webmozart-assert)[swaggest/json-schema

High definition PHP structures with JSON-schema based validation

48612.5M73](/packages/swaggest-json-schema)[stevebauman/purify

An HTML Purifier / Sanitizer for Laravel

5325.6M19](/packages/stevebauman-purify)[brick/postcode

A library to format and validate postcodes

861.7M5](/packages/brick-postcode)[ashallendesign/laravel-config-validator

A package for validating your Laravel app's config.

217905.3k5](/packages/ashallendesign-laravel-config-validator)[crazybooot/base64-validation

Laravel validators for base64 encoded files

1341.9M8](/packages/crazybooot-base64-validation)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
