LOADING STUFF...

php表单习惯用的正则表达式

技术教程6小时前更新 北陌
8 0 0

php表单习惯用的正则表达式

php表单常用正则表达式,代码如下所示:

function is_email($str){
//检验email
return preg_match(“/^w ([- .]w )*@w ([-.]w )*.w ([-.]w )*$/”, $str);
}
function is_url($str){
//检验网址
return preg_match(“/^http://[A-Za-z0-9] .[A-Za-z0-9] [/=?%-

© 版权声明

相关文章

暂无评论

暂无评论...