467,212 Members | 1,127 Online
Bytes | Developer Community
Ask Question

Home New Posts Topics Members FAQ

Post your question to a community of 467,212 developers. It's quick & easy.

Find Country Code for Phone Number using PHP

Respected sir/madam,

In My Application, users can send me an email with some keyword 'XXXX' to our mail server 'XXXX@xxxxx.com'.i am using imap_open() and other imap functions to read that email and auto respond the email.

My Issue is, i am receiving some email with country code as email id(say <country code><phonenumber>@<carrier.com> and some without country code as email id <numberphonenumber>@<carrier.com>

Is there any way to match <country code> using Phone Number.I thought to implement this concept.but i don't think its 100% perfect

if phone number start with '9',i will attach indian country code as 91(bcz indian mobile numbers usually start with 9)
if phone number start with '2',i will attach US country code as 1.

i want to make sure,if there any other way to resolve my siiue or can i proceed with my current implementation.

Thanxs for suggesting some ideas.

Yours Respectively,
A.Suresh Kumar
Feb 11 '08 #1
  • viewed: 4002
1 Reply
I doubt that you'll be able to implement this the way you've set out. If I get you right, you're asking this question:
"Is it possible for me to determine the country of origin of a phone number, simply from analysing to the phone number itself?"
The answer would be a categorical "NO", as the very part of the number that would have helped you is the country code itself!
For one thing, in Nigeria, there are dozens of phone networks, with many, many number patters varying with the kind of platform. When you add different area codes, it gets even more complicated. See?
So, why not just provide for users to choose their country from a form?
Feb 11 '08 #2

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

5 posts views Thread by joemono | last post: by
7 posts views Thread by Lloyd Dupont | last post: by
5 posts views Thread by lim4801 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.