Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New Coder
    Join Date
    Apr 2006
    Posts
    33
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Regular Expressions

    Hi I need help on regular expressions:. I need to know how to manipulate the telephone data on the form. e.g. if the user inserts, (012)7993456.

  • #2
    Regular Coder
    Join Date
    Mar 2006
    Location
    Nigeria
    Posts
    192
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Explain wat u mean by the term manipulate

  • #3
    Regular Coder
    Join Date
    Jan 2006
    Location
    Finland, Hollola
    Posts
    285
    Thanks
    8
    Thanked 0 Times in 0 Posts
    Yes, exactly. You need to be more specific...

    Here a sample to get the country code:
    PHP Code:
    preg_match("/\\(\d+\\)/",$text,$matches);
    echo 
    $matches[0]; // Echoes 012 in your case 
    PHP 5 & MySQL 5 (Y)


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •