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
Release: 2016-07-13 09:58:02
Original
1001 people have browsed it

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