Re: Get country from Phone number

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

 



Dani Castaños wrote:

As a little project, I took the link provided by "the other" Rob and make this little search tool.

It only looks at the beginning numbers. It does no number validation. I don't validate the length of the number. ie: I would have to know the min/max lenth of each phone number for that given country/region, and I didn't search for that information.

Let me know what you'll think.

http://www.cmsws.com/examples/php/areacodes/countrycodes.php


It's enough for me... Can you send me the code please?


I am making the source available here.

http://www.cmsws.com/examples/php/areacodes/countrycodes.phps

Take note, this is not a complete list of all the possible country/region codes, I made it more specific where needed. A couple countries have the same country code, so from the page mentioned before, I took and got a little more specific, just so there wasn't any collisions. There still are, and in that case, I "join" all the country names together with " or ". Should work for most cases, you could always just pull the first country name listed. You will see what I mean when you look at the code.

--
Jim Lucas

   "Some men are born to greatness, some achieve greatness,
       and some have greatness thrust upon them."

Twelfth Night, Act II, Scene V
    by William Shakespeare

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