function Funcphone ($STR)//telephone number regular expression trial {return (Preg_match ("/^ ((D{3})) | ( d{3}-))? ((0d{2,3}) |0d{2,3}-)? [1-9]d{6,8}$/", $str))? True:false;} Use the method if (Funcphone (' 0731-88888888 ')) {echo ' correct phone number ';} else{Echo ' Sorry, the phone number you entered is incorrect ';} function Funcmtel ($STR)//Cell phone number regular expression trial {return (Preg_match ("/(?: 13d{1}|15[03689]) d{8}$/", $str))? True:false;} Mobile phone number Verification app if (Funcmtel (' 13875888888 ')) {echo ' you entered the phone number is correct ';} else{echo ' Please enter legal China Mobile or mobile phone number ';}
http://www.bkjia.com/PHPjc/447008.html www.bkjia.com true http://www.bkjia.com/PHPjc/447008.html techarticle function Funcphone ($STR)//telephone number regular expression trial {return (Preg_match (/^ ((d{3)) | ( d{3}-))? ((0d{2,3}) |0d{2,3}-)? [1-9]d{6,8}$/, $str)]? True:false;} How to use the IF (Funcphone (0 ...