By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
438,747 Members | 2,011 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 438,747 IT Pros & Developers. It's quick & easy.

Find Country Code for Phone Number using PHP

P: 32
Respected sir/madam,

In My Application, users can send me an email with some keyword 'XXXX' to our mail server ''.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>@<> and some without country code as email id <numberphonenumber>@<>

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
Share this Question
Share on Google+
1 Reply

P: 60
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.