ok, I have an html file and I need to get the links in it out. But I dont know PHP well to do it, all I want is the HREF"" bit and the link text
1 reply to this topic
Posted 04 July 2006 - 02:16 PM
That's the beauty of asymmetric warfare. You don't need a lot of money, or an army of people. You can do it from the comfort of your living room, with a beer in your hand.
Posted 04 July 2006 - 02:38 PM
preg_match_all('/<a href="(.*?)">(.*?)<\/a>/si',$html_text,$matches); preg_match_all('/<a.*?href="(.*?)".*?>(.*?)<\/a>/si',$html_text,$matches);
That should put the link(s) in the $matches array. The second one takes into consideration links with other "stuff" in them. See the manual page for this function for more information.
Twice a day my clock works PERFECTLY! I can't figure out what's wrong with it.
0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users