473,406 Members | 2,293 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

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
1 5422
ifedi
60
Hi,
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?
Regards,
Ifedi.
Feb 11 '08 #2

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

Similar topics

5
by: joemono | last post by:
Hello everyone! First, I appologize if this posting isn't proper "netiquette" for this group. I've been working with perl for almost 2 years now. However, my regular expression knowledge is...
8
by: jquest | last post by:
Hi Again; I have had help from this group before and want to thank everyone, especially PCDatasheet. My database includes a field called HomePhone, it uses the (xxx)xxx-xxx format to include...
90
by: Bret Pehrson | last post by:
This message isn't spam or an advertisement or trolling. I'm considering farming some of my application development to offshore shops (I'm in the US). I have absolutely *no* experience w/ this,...
7
by: Lloyd Dupont | last post by:
from the IP of the request ?
1
by: Scott F K Hooper | last post by:
My ASP.NET 2.0 project has a GridView that I want to be able to edit and update records with. The GridView has been bound to an ObjectDataSource control that has the following Update method...
5
by: lim4801 | last post by:
I am currently in doing a program which is given by my tutor: Contemplate that you are working for the phone company and want to sell "special" phone numbers to companies. These phone numbers are...
2
by: kl | last post by:
Hi, I'm trying to learn some STL using map or hash_map would maybe even better to use but I don't really know how to find a specific struct depending on a DWORD value that is in range of two...
0
by: nimjerry | last post by:
i am using db2 udb V 9 on aix 5.3 and in db2diag.log alwas has this error occurr below is sample message 2008-03-03-09.45.34.366406+420 I306667A443 LEVEL: Warning PID : 835622 ...
3
by: vamsioracle | last post by:
Hi could someone explain me what kind of a code is this. CREATE OR REPLACE PACKAGE BODY APPS.FFP3613_01011951 AS /* Code generated by Oracle FastFormula - do not edit. Formula Name:...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.