当前位置:Gxlcms > PHP教程 > 正则表达式验证老是失败

正则表达式验证老是失败

时间:2021-07-01 10:21:17 帮助过:13人阅读

                    


回复讨论(解决方案)

我要验证一个位数为10位的数字、

if(preg_match("/^\d{10}$/", $_POST[username]))

现在还能用ereg么?

ereg(" [0-9]{10}", $_POST[username])

现在还能用ereg么?
求问大神?为什么不使用了?

Deprecated: Function ereg() is deprecated
Deprecated 已过时

人气教程排行