Re: Get country from Phone number

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

 



On Fri, Feb 29, 2008 at 5:02 AM, Dani Castaños
<danitao.mailists@xxxxxxxxx> wrote:
> 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?

    Most likely you'll need a database, because you'll have to store
all area codes, as well.  It's not enough to go by Country Code unless
you just want the continent to which the number terminates.

    For example, I live in Pennsylvania (USA), and my country code is
1, my area code is 570 (and my exchange is 362, but that's getting
municipal).  If I want to call Enterprise Network Consulting in
Whitehorse, Yukon, Canada, the country code is still 1, the area code
is 867 (and the local exchange is 668).  Both numbers are 11-digits in
length, including the country code, yet terminate in different
countries entirely, and are over 3,500 miles (>5600 kilometers) apart.

    So unless you wanted to split by continental region (e.g. - North
America), then you'll need a database.  Aside from that, the
programming itself would be a piece of cake.

-- 
</Dan>

Daniel P. Brown
Senior Unix Geek
<? while(1) { $me = $mind--; sleep(86400); } ?>

-- 
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