Well I’ll start off by saying I’m not dead. I’m very much a live and kicking. Sorry for the delay in posting, however, I have been working on a couple of big projects which I will post about here soon so check back to find out more.
Anyway back on topic I thought I would share a really neat piece of code with you. I recently had the need to validate a UK post code, using PHP, and decided it was worth looking to see what other people had developed (no point in reinventing the wheel). I found a very useful piece of code at braemoor.co.uk that offers full UK Postcode validation as per the official specification and from the list of BFPO codes.
The code is very thorough and works like a charm so I would definitely recommend it. They also offer other validation methods for UK telephone numbers, National Insurance, Credit Card, Email Address etc in a multitude of languages including JavaScript, PHP, ASP and PERL so check it out.


2 Comments Received
God Bless you !
Unfortunately this code uses ereg function which is not available in PHP6. I’m tyying to convert it but no luck so far
Leave A Reply