Jump to content


Photo

Listing links from page


  • Please log in to reply
1 reply to this topic

#1 XeroXer

XeroXer
  • Members
  • PipPipPip
  • Advanced Member
  • 80 posts
  • LocationSweden

Posted 08 May 2006 - 07:15 AM

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:
<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>

I want to get out this:
http://www.otherpage.com/1.html
http://www.otherpage.com/2.html
http://www.otherpage.com/3.html
http://www.otherpage.com/4.html
http://www.otherpage.com/5.html

Anyone have any ideas?
// XeroXer

#2 Kris

Kris
  • Staff Alumni
  • Advanced Member
  • 2,755 posts
  • LocationThe Internet

Posted 08 May 2006 - 08:41 AM

You could use preg_match(). Check [a href=\"http://www.regularexpressions.info\" target=\"_blank\"]http://www.regularexpressions.info[/a] for help with regex.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users