re: [PHP] Zip to postcode
| From: | Peter Hicks | Date: | Wed, 02 Apr 2003 12:33:35 +0000 |
| Subject: | re: [PHP] Zip to postcode | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-141973@lists.php.net to get a copy of this message | ||
Don't forget some London postcodes are Q1Q QQQ!
Peter.
On Wed, 2 Apr 2003, skate wrote:
> sorry, don't have anything to add for code, but just a note to remember that UK post codes
> can also be in the form...
>
> QQ11 1QQ
> Q1 1QQ
> Q11 1QQ
> QQ1 1QQ
>
> so it's a real pain to write an expression for this...
>
> -skate-
>
>
>
>
> 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
>
>
>
>