Re: International Addresses and Telephones
| From: | Mike | Date: | Thu, 04 Dec 2003 16:36:58 +0000 |
| Subject: | Re: International Addresses and Telephones | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-171854@lists.php.net to get a copy of this message | ||
have a look at the pear Validate class - this is what you need.
In the UK the postal code is (as a preg expression)
/[A-Za-z]{1,2}[0-9]{1,2}[A-Za-z]\s?[1-9][A-Za-z]{2}/
these are valid postcodes
B1 4RT
B56 6TY
BN5 6ER
SW1A 1AA (<- the queen @ buck palace)
SW14 5RT
ie. one or 2 letters, followed by one or 2 numbers, followed by optional
letter (only for some central london addys i think) [space] 1 number
(not 0) followed by 2 letters
our telephone system is a bit of a c0ck up and so we can have lots of
different numbers, generally though
01 or 02 - normal land lines
07 - mobile phones
08 - 'special rate numbers' either free/local or national rate
09 - the expensive 10p - 1.50 per minute
tel numbers can be from 9 to 12 numbers i spose (just to be sure)
On Thu, 2003-12-04 at 15:53, Rankin, Randy wrote:
> I have a form which captures US addresses ( address, city, state ) and
> telephone numbers ( 10 digit ) and am writing this data to a MySQL table. I
> need to expand this to capture non-US info, so I was hoping for some
> guidance on forms and table structures. I have googled this to death and
> still haven't come up with anything.