Copy code The code is as follows:
$url = 'http://www.baidu.com/ zongzi/oo.html';
$n = preg_match_all("/http:[/]{2}[a-z]+[.]{1}[a-zd-]+[.]{1}[a -zd]*[/]*[A-Za-zd]*[/]*[A-Za-zd]*[.]*html/",$url,$array);
var_dump($array );
?>
http://www.bkjia.com/PHPjc/323946.htmlwww.bkjia.comtruehttp: //www.bkjia.com/PHPjc/323946.htmlTechArticleCopy the code as follows: ?php $url = 'http://www.baidu.com/zongzi/oo .html'; $n = preg_match_all("/http:[/]{2}[a-z]+[.]{1}[a-zd-]+[.]{1}[a-zd]*[/ ]*[A-Za-zd]*[/]*[A-Za-zd]*...