preg question

From: Date: Thu, 12 Apr 2001 22:47:35 +0000
Subject: preg question
Groups: php.general 
Request: Send a blank email to php-general+get-48369@lists.php.net to get a copy of this message
on http://www.php.net/manual/en/function.preg-match-all.php there is a regex: $url = "http://www.catho.com.br/index.phtml"; $contents = Implode("", File($url)); preg_match_all("|href=\"?([^\"' >]+)|i", $contents, $arrayoflinks); While(List(,$link) = Each($arrayoflinks[1])) Echo "$link<Br>"; that pulls allthe urls out of a document by finding the href=. What I need to find is all the urls in the document and make hrefs out of them. ie: http://www.mysite.com becomes &lt;a href="http://www.mysite.com"&gt;http://www.mysite.com&lt;/a&gt; any ideas? TIA! Michael Geier CDMSports Systems Administration EMail: mgeier@cdmsports.com Phone: 314.991.1511 x 6505

« previous php.general (#48369) next »