Home >Backend Development >PHP Tutorial >How to get all links on a web page in php_PHP tutorial

How to get all links on a web page in php_PHP tutorial

WBOY
WBOYOriginal
2016-07-13 09:58:021002browse

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*[^>]*>([^>] )/i',$code,$arr);
return array('name'=>$arr[2],'url'=>$arr[1]);
}
?>

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