PHP preg_match prompt warning.
The code is as follows:
function Isvaliddomain ($domain) {
if (Preg_match ("/^ (HTTP|FTP)://(www\.)?". +\. (com|org|net) $/i ", $domain))
Return $domain. ' is a legal domain name ';
Else
return $domain. ' is not a legal domain name ';
}
Echo Isvaliddomain ("http://www.aixi.com");
?>
Operation Result:
Warning:preg_match (): Unknown modifier '/' in D:\wamp\www\www.yoyou.com\this.php on line 3
Http://www.aixi.com is not a legal domain
Ps:php is version 5.4
------to solve the idea----------------------
"/^ (http
------to solve the idea----------------------
FTP): \/ \/(www\.)?. +\. (COM
------to solve the idea----------------------
Org
------to solve the idea----------------------
NET) $/i "
Or
" #^ (http
------to solve the idea----------------------
FTP)://(www\.)?. +\. (COM
------to solve the idea----------------------
Org
------to solve the idea----------------------
NET) $ #I
------to solve the idea----------------------
For slashes if you don't want to move, use # or @ or! All right
------to solve the idea----------------------
Less meaning, so wrong.