Jump to content


This topic is now archived and is closed to further replies.


Listing links from page

Recommended Posts

Hi there!

This is what I want to be able to do.
If I have a page. Let's say [a href=\"http://www.mywebpage.com/links.html\" target=\"_blank\"]http://www.mywebpage.com/links.html[/a].
And I want to get all the links from that page listed for me in plain text.

So if the page has these one:
[code]<a href="http://www.otherpage.com/1.html">1</a>
<a href="http://www.otherpage.com/2.html">2</a>
<a href="http://www.otherpage.com/3.html">3</a>
<a href="http://www.otherpage.com/4.html">4</a>
<a href="http://www.otherpage.com/5.html">5</a>[/code]

I want to get out this:

Anyone have any ideas?

Share this post

Link to post
Share on other sites
You could use preg_match(). Check [a href=\"http://www.regularexpressions.info\" target=\"_blank\"]http://www.regularexpressions.info[/a] for help with regex.

Share this post

Link to post
Share on other sites


Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.