note 9913 modified in preg_match_all by ronabop
| From: | ronabop@php.net | Date: | Wed, 06 Dec 2000 06:16:28 +0000 |
| Subject: | note 9913 modified in preg_match_all by ronabop | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-8455@lists.php.net to get a copy of this message | ||
//This example will list (actually put on an array) all the urls adresses from a specific $url,
where $url = "http://www.whatever.com"
$url = "http://www.catho.com.br/index.phtml";
$contents = Implode("", File($url));
preg_match_all("|href=\"?([^\"' >]+)|i", $contents, $arrayoflinks);
//Listing the array
While(List(,$link) = Each($arrayoflinks[1]))
Echo "$link<Br>";
http://www.php.net/manual/function.preg-match-all.php