Simple function to get all hyperlinks on a page:
- function get_all_url($cnstr){
- preg_match_all(/" ] )["|]?s*[^>]*>([^>] )/i,$cnstr,$arr);
- return array(name=>$arr[2],url=>$arr[1]);
- }
- //Call function
- $url = www.ite5e.com;
- echo get_all_url($url);
- ?>
It’s very simple to use, just pass in a URL address.
http://www.bkjia.com/PHPjc/486187.htmlwww.bkjia.comtruehttp: //www.bkjia.com/PHPjc/486187.htmlTechArticleA simple function to get all hyperlinks on a page: ?php function get_all_url($cnstr){ preg_match_all(/as href=["|]?([^" ] )["|]?s*[^]*([^] )/a/i,$cnstr,$arr); return array(name...
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