标签:
1 PHP - 验证 E-mail 2 3 $email = test_input($_POST["email"]); 4 if (!preg_match("/([\w\-]+\@[\w\-]+\.[\w\-]+)/",$email)){ 5 $emailErr = "无效的 email 格式!"; 6 } 7 8 9 PHP - 验证 URL 10 11 $website = test_input($_POST["website"]); 12 if (!preg_match("/\b(?:(?:https?|ftp):\/\/|www\.)[-a-z0-9+&@#\/%?=~_|!:,.;]*[-a-z0-9+&@#\/% 13 =~_|]/i",$website)){ 14 $websiteErr = "无效的 URL"; 15 }
标签:
原文地址:http://www.cnblogs.com/719907411hl/p/4507460.html