Re: Get country from Phone number

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



It is not as bad as it looks. The only important columns are the first two, the last two are how you dial from within the country to place long distance international or national calls. In many countries, when there are several low cost international call providers, they use different prefixes, actually, it is quite absurd that they list all options for low cost carriers for, say, Venezuela, while they don't for the USA where there are as many or more.

The only tough part is that several countries, share the +1 prefix, the USA and Canada are the larger, but many Caribean countries, which originally got their service through the US phone system, are also mixed in. So, in those cases, you have to check through the 'area codes'. A similar thing happens with the ex-Soviet republics, they all share the 7 prefix.

As for the rest, it is quite straighforward.

1 is North America
2 is Africa
3 and 4 Europe
5 rest of the Americas
6 Oceania
7 Russia and ex-soviet republics
8 FarEast
9 rest of Asia

Most prefixes are of varying lenghts. The countries with the most phone lines get the shorter prefixes so the overall number is more or less the same for all. Thus, Mexico and Brazil get two digit codes in the 5 range while smaller Nicaragua gets three.

Satyam


----- Original Message ----- From: "Andrés Robinet" <agrobinet@xxxxxxxxxxxxx> To: "'Dani Castaños'" <danitao.mailists@xxxxxxxxx>; "'PHP LIST'" <php-general@xxxxxxxxxxxxx>
Sent: Friday, February 29, 2008 11:17 AM
Subject: RE:  Get country from Phone number


-----Original Message-----
From: Dani Castaños [mailto:danitao.mailists@xxxxxxxxx]
Sent: Friday, February 29, 2008 5:03 AM
To: PHP LIST
Subject:  Get country from Phone number

Hi all!

I'm looking for some piece of code or class which giving a phone number
it returns me from wich country is this phone.
Do you know where I can find something like this?

Thank you in advanced!

--

Seems like you'll have a hard time if you want to include all the possibilities:
http://www.kropla.com/dialcode.htm
But probably Rob (Cummings) will come up with a "solve-it-all" regex that will
save your day.

Regards,

Rob(inet)


Andrés Robinet | Lead Developer | BESTPLACE CORPORATION
5100 Bayview Drive 206, Royal Lauderdale Landings, Fort Lauderdale, FL 33308 |
TEL 954-607-4207 | FAX 954-337-2695 |
Email: info@xxxxxxxxxxxxx | MSN Chat: best@xxxxxxxxxxxxx | SKYPE: bestplace |
Web: bestplace.biz | Web: seo-diy.com

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




--
No virus found in this incoming message.
Checked by AVG Free Edition.
Version: 7.5.516 / Virus Database: 269.21.1/1303 - Release Date: 28/02/2008 12:14



--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux