PHP正则验证 邮箱 和 URL

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/qq_41669475/article/details/89333650

preg_match("/([\w\-]+\@[\w\-]+\.[\w\-]+)/",$email)

 

preg_match("/\b(?:(?:https?|ftp):\/\/|www\.)[-a-z0-9+&@#\/%?=~_|!:,.;]*[-a-z0-9+&@#\/%=~_|]/i",$url)

 

猜你喜欢

转载自blog.csdn.net/qq_41669475/article/details/89333650