How to get all the links on the webpage in php
The example in this article describes the method of getting all the links on the webpage in php. Share it with everyone for your reference. The specific implementation method is as follows:
The code is as follows:
function get_all_url($code){
preg_match_all('/
"' ] )["|']?s*[^>]*>([^>] ) a>/i',$code,$arr);
return array('name'=>$arr[2],'url'=>$arr[1]);
}
?>
http://www.bkjia.com/PHPjc/979235.htmlwww.bkjia.comtruehttp: //www.bkjia.com/PHPjc/979235.htmlTechArticleHow to get all the links on the webpage with php. This article describes the method of getting all the links on the webpage with php. Share it with everyone for your reference. The specific implementation method is as follows: The code is as follows: ?p...
Statement: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