Phone number Regular expression instance of mobile phone number
<title>Phone number Regular expression instance of mobile phone number</title>
Input 13875998850
Output effective Contact information
Input 0136986+9557
There is a problem with the output contact method
function Funcphone ($STR)//telephone 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;
}
function Funcmtel ($STR)//Mobile phone number regular expression test
{
Return (Preg_match ("/(?: 13d{1}|15[03689]) d{8}$/", $str))? True:false;
}
if ($_post)
{
if (Funcphone ($_post[' url ')) | | funcmtel ($_post[' url '))
{
Echo ' effective contact method ';
}
Else
{
Exit (' problem with contact ');
}
}
?>
http://www.bkjia.com/PHPjc/444971.html www.bkjia.com true http://www.bkjia.com/PHPjc/444971.html techarticle Phone number Regular expression instance of phone number! DOCTYPE HTML Public-//w3c//dtd XHTML 1.0 transitional//en HTTP://WWW.W3.ORG/TR/XHTML1/DTD/XHTML1-TRANSITIONAL.DTD HTML xmlns=http: ...