最新php手机号正则表达式 示例
以下是三零网为大家整理的最新php手机号正则表达式 示例的文章,希望大家能够喜欢!
/** * 验证是否是手机号码 三零网 www.q3060.com * * @param string $phone 待验证的号码 * @return boolean 如果验证失败返回false,验证成功返回true */ function isTelNumber($phone) { if (strlen ( $phone ) != 11 || ! preg_match ( '/^1[3|4|5|7|8][0-9]\d{4,8}$/', $phone )) { return false; } else { return true; } } |
联系客服