hno Posted July 11, 2010 Share Posted July 11, 2010 HI every one I have read an webpage with curl . Now , I want to store all link's address in the source How can I do so ? thanks Link to comment https://forums.phpfreaks.com/topic/207426-how-to-retrive-all-links-in-an-html-code/ Share on other sites More sharing options...
hno Posted July 12, 2010 Author Share Posted July 12, 2010 HI every one I have read an webpage with curl . Now , I want to store all link's address in the source How can I do so ? thanks there is no way ? Link to comment https://forums.phpfreaks.com/topic/207426-how-to-retrive-all-links-in-an-html-code/#findComment-1084703 Share on other sites More sharing options...
dezkit Posted July 12, 2010 Share Posted July 12, 2010 there is Link to comment https://forums.phpfreaks.com/topic/207426-how-to-retrive-all-links-in-an-html-code/#findComment-1084704 Share on other sites More sharing options...
myrddinwylt Posted July 12, 2010 Share Posted July 12, 2010 Sounds like a job for RegEx. $code = "your html here"; $regex = "~a[^href]*href=\"([^\\"]*)\"~"; preg_match_all('~Select Row</LABEL>.*?>(.*?)</TR>~', $code, $out); foreach($out[1] as $matchedrow) { echo $matchedrow; } Link to comment https://forums.phpfreaks.com/topic/207426-how-to-retrive-all-links-in-an-html-code/#findComment-1084749 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.