Re: Extracting hyperlinks from file

From: Date: Thu, 21 Feb 2002 11:41:03 +0000
Subject: Re: Extracting hyperlinks from file
References: 1 2  Groups: php.general 
Request: Send a blank email to php-general+get-85707@lists.php.net to get a copy of this message
ooops sorry The correct is : preg_match_all('/<a.*?href=("|'|)(.*?)("|')/i', $the_string,$the_matches); var_dump($the_matches); ----- Original Message ----- From: "Andrey Hristov" <ahristov@icygen.com> To: "Ando Saabas" <ando.saabas@ttu.ee>; <php-general@lists.php.net> Sent: Thursday, February 21, 2002 1:35 PM Subject: Re: [PHP] Extracting hyperlinks from file > Use preg_match_all('|<a.*?href=("|'|)(.*?)("|')|i', > $the_string,$the_matches); > var_dump($the_matches); > > Regards, > Andrey Hristov > > ----- Original Message ----- > From: "Ando Saabas" <ando.saabas@ttu.ee> > To: <php-general@lists.php.net> > Sent: Wednesday, February 20, 2002 10:45 PM > Subject: [PHP] Extracting hyperlinks from file > > > > I need to produce an array of all the links(hrefs) in a remote file > > (actually those that refer to files in the same remote server, but thats > > > > another matter). > > I'm pretty new to php, i was thinking of doing it with ereg, something > > like eregi("a href[\"]?=(.*)>", $file, $link); > > but i cannot think of a way to make it walk through the whole string, so > > > > it would find all the links, not just the first one. > > Any ideas? > > > > Ando > > > > > > -- > > PHP General Mailing List (http://www.php.net/) > > To unsubscribe, visit: http://www.php.net/unsub.php > > > > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > >

« previous php.general (#85707) next »