How to get all links from a webpage?
| From: | Wudi | Date: | Sat, 24 Jul 2004 05:36:14 +0000 |
| Subject: | How to get all links from a webpage? | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-191725@lists.php.net to get a copy of this message | ||
How can I get all links from a webpage?
For example the HTML sources is:
<a href="../page2.htm">Page 2</a>
<img src="http://www.host.com/path/logo.png">
And I want to get:
print_r($links)
Array
(
[Page 2] => ../page2.htm
)
print_r($images)
Array
(
[0] => http://www.host.com/path/logo.png
)
How to achieve?
--------------------------------------------------
Comment: English is not my first language.
Wudi <wudicgi@yahoo.de>