如何检查给定的手机号码是10位数 [英] How to check the given mobile number is 10 digits

查看:81
本文介绍了如何检查给定的手机号码是10位数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

朋友......我需要一个代码来检查手机号码。哪个必须包含10位数的php pgm?

friends...I need a code for check the mobile no. which is must contains 10 digits in php pgm?

推荐答案

请参阅:

http://php.net/manual/en/function.preg-match.php [ ^ ],

http://php.net/manual/en/reference.pcre.pattern.syntax.php [ ^ ]。



-SA
Please see:
http://php.net/manual/en/function.preg-match.php[^],
http://php.net/manual/en/reference.pcre.pattern.syntax.php[^].

—SA


使用正则表达式:

Use a regex:
^\d{10}


正好需要10位数字,没有其他内容

Requires exactly 10 digits, and nothing else


这篇关于如何检查给定的手机号码是10位数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆