note 18745 deleted from function.ereg by didou
| From: | didou@php.net | Date: | Sun, 07 Dec 2003 02:57:54 +0000 |
| Subject: | note 18745 deleted from function.ereg by didou | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-61551@lists.php.net to get a copy of this message | ||
Note Submitter: jolyon@mways.co.uk
----
The postcode example listed here isn't correct - it won't correctly detect Inner London
postcodes (and others?) with an extra letter, eg:
EC1M 3AA
I've also ammended it so that the space is optional:
if(eregi('^[A-Z]{1,2}[0-9]{1,2}[A-Z]? ?[0-9][A-Z]{2}$',$postcode)
{
print "You have a valid postcode!";
}