Php verifies the regular expression of the phone number and phone number. Functionfuncphone ($ str) phone number regular expression test {return (preg_match (^ (d {3}) | (d {3 }-))? (0d {2, 3}) | 0d {2, 3 }-)? [1-9] d {6, 8 }$, $ str ))? True: false;} usage method if (funcphone (0
Function funcphone ($ str) // call number regular expression test {return (preg_match ("/^ (d {3}) | (d {3 }-))? (0d {2, 3}) | 0d {2, 3 }-)? [1-9] d {6, 8} $/", $ str ))? True: false;} // usage if (funcphone ('1970-0731 ') {echo 'correct phone number';} else {echo' sorry, the phone number you entered is incorrect ';} function funcmtel ($ str) // try {return (preg_match ("/(? : 13d {1} | 15 [03689]) d {8} $/", $ str ))? True: false;} // app for mobile phone number verification if (funcmtel ('000000') {echo 'Your entered mobile phone number is correct ';} else {echo 'Enter the valid mobile phone number of China Mobile or the linked mobile phone number ';}
Http://www.bkjia.com/PHPjc/447008.htmlwww.bkjia.comtruehttp://www.bkjia.com/PHPjc/447008.htmlTechArticlefunction funcphone ($ str) // call number regular expression try {return (preg_match (/^ (d {3}) | (d {3 }-))? (0d {2, 3}) | 0d {2, 3 }-)? [1-9] d {6, 8} $/, $ str ))? True: false;} // Usage method if (funcphone (0...