php正则匹配问题,有警告

WBOY
Release: 2016-06-02 11:34:04
Original
977 people have browsed it

正则匹配phppreg match

php 5.4的版本,代码运行提示警告。

提示如下:
Warning: preg_match(): Unknown modifier '/' in D:\wamp\www\www.yoyou.com\this.php on line 3
http://www.aixi.com不是合法域名

代码如下:
function isValidDomain($domain){
if(preg_match("/^(http|ftp)://(www.)?.+.(com|org|net)$/i",$domain))
return $domain.'是合法域名';
else
return $domain.'是合法域名';
}

echo isValidDomain("http://www.aixi.com");
?>

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!