function checkMobile($str)
{
$pattern = "/^(13|15)/d{9}$/"; //此处验证条件不全
if (preg_match($pattern,$str))
{
Return true;
}
else
{
Return false;
}
}
$str = checkMobile("15800000001");
if($str)
{
echo("符合手机号码标准");
}
else
{
echo("不符合手机号码标准");
}
转载于:https://my.oschina.net/shihuipengx/blog/374023