How do you get country dialling code from a mobile phone number?
-
Not sure if this is possible but I thought I'd ask: I'm using mobile phone verification that checks to see if a mobile number was turned on in the last week using a service from liquid11 - which I've tested and works brilliantly. The only problem is it requires the mobile number to be formatted with the country code prefix - e.g. "+44". So.. how can you get country dialling code from a mobile phone number? i.e: If a user enters 07123456789, and the phone is in the UK it would need to be converted into the format "+447123456789" And I can't get the users to enter the prefix either (which would make life a lot easier), so it has to be some form of lookup. Any ideas?
-
Not sure if this is possible but I thought I'd ask: I'm using mobile phone verification that checks to see if a mobile number was turned on in the last week using a service from liquid11 - which I've tested and works brilliantly. The only problem is it requires the mobile number to be formatted with the country code prefix - e.g. "+44". So.. how can you get country dialling code from a mobile phone number? i.e: If a user enters 07123456789, and the phone is in the UK it would need to be converted into the format "+447123456789" And I can't get the users to enter the prefix either (which would make life a lot easier), so it has to be some form of lookup. Any ideas?
You could store all the prefixes (country codes) in a database as well as the numbers (NDD National Prefix) to be replaced. This would only be useful if the user selects the right country from another input. I would store both the initial and the replaced numbers, just in case the user decides to change thier country at a later date. Only the replaced number should be place in text, to make sure the user selects the right country. It could be added on to an existing language table, such as those used for translations etc, without too much hassle. Added: The source I got my data from: http://www.kropla.com/dialcode.htm[^]
If at first you don't succeed, you're not Chuck Norris.
-
You could store all the prefixes (country codes) in a database as well as the numbers (NDD National Prefix) to be replaced. This would only be useful if the user selects the right country from another input. I would store both the initial and the replaced numbers, just in case the user decides to change thier country at a later date. Only the replaced number should be place in text, to make sure the user selects the right country. It could be added on to an existing language table, such as those used for translations etc, without too much hassle. Added: The source I got my data from: http://www.kropla.com/dialcode.htm[^]
If at first you don't succeed, you're not Chuck Norris.
fly904 wrote: NDD National Prefix Cheers! That's what I was looking for. Didn't know what it was called.