Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. Linux, Apache, MySQL, PHP
  4. How do you get country dialling code from a mobile phone number?

How do you get country dialling code from a mobile phone number?

Scheduled Pinned Locked Moved Linux, Apache, MySQL, PHP
phpdesignhostinghelpquestion
3 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    Marc Firth
    wrote on last edited by
    #1

    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?

    Portfolio | Web Design, Web Hosting & IT Support

    F 1 Reply Last reply
    0
    • M Marc Firth

      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?

      Portfolio | Web Design, Web Hosting & IT Support

      F Offline
      F Offline
      fly904
      wrote on last edited by
      #2

      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.

      M 1 Reply Last reply
      0
      • F fly904

        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.

        M Offline
        M Offline
        Marc Firth
        wrote on last edited by
        #3

        fly904 wrote: NDD National Prefix Cheers! That's what I was looking for. Didn't know what it was called.

        Portfolio | Web Design, Web Hosting & IT Support

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups