RE: [PHP] Zip to postcode[Scanned]
| From: | Michael Egan | Date: | Wed, 02 Apr 2003 12:04:50 +0000 |
| Subject: | RE: [PHP] Zip to postcode[Scanned] | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-141968@lists.php.net to get a copy of this message | ||
Andy,
There are some ready made scripts for dealing with UK post codes on the relevant page on the PHP
site:
http://www.php.net/manual/en/function.ereg.php
HTH,
Michael Egan
-----Original Message-----
From: Andy [mailto:andy.davey@tiscali.co.uk]
Sent: 02 April 2003 12:54
To: php-general@lists.php.net
Subject: [PHP] Zip to postcode[Scanned]
Can someone please tell me how i change the following code:
if (!ereg("^[0-9]{5,5}(\-[0-9]{4,4})?$",$postcode))
to a UK postcode QQ1 1QQ
When i fill out the form it tells me that the postcode is not valid and i
think it is because it is in zip code format.
Thank you
Andy
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php