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 Quote 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 ? Quote 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 Quote 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; } Quote 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
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.