php判断是否4到11位数字
php判断是否是5到20位数字字母下划线减号
preg_match('/^\d{4,11}$/', $text)
preg_match('/^[\w-]{5,20}$/', $text)
preg_match('/^\d{4,11}$/', $text)
preg_match('/^[\w-]{5,20}$/', $text)
if(preg_match('/^\d{4,11}$/', $text)){write_msg("QQ号格式不正确") } if(preg_match('/^\d{4,11}$/', $text)){write_msg("QQ号格式不正确"); }
这样不行啊
php判断是否4到11位数字
php判断是否是5到20位数字字母下划线减号
preg_match返回1,匹配到了,是正确的,改为:
if(!preg_match('/^\d{4,11}$/', $text)){write_msg("QQ号格式不正确"); }
第几行报错?你还有其他代码吧。
搞定
if(preg_match('/^\d{4,11}$/', $text)){write_msg("QQ号格式不正确"); }
这样不行啊
php判断是否4到11位数字
php判断是否是5到20位数字字母下划线减号
PHP怎么学习?PHP怎么入门?PHP在哪学?PHP怎么学才快?不用担心,这里为大家提供了PHP速学教程(入门到精通),有需要的小伙伴保存下载就能学习啦!
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号