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