Posted By

Shifter on 07/12/09


Tagged

phone number validate america


Versions (?)

Who likes this?

1 person have marked this snippet as a favorite

irishsk


Validate North America Phone Number


 / Published in: PHP
 

  1. function fnValidatePhone($mValue)
  2. {
  3. $sPattern = '/^[\(]?[0-9]{3}[\)]?[-. ]?[0-9]{3}[-. ]?[0-9]{4}$/';
  4. return preg_match($sPattern, $mValue);
  5. }

Report this snippet  

You need to login to post a comment.