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...