ohdang888 Posted March 25, 2009 Share Posted March 25, 2009 i am using $content = file_get_contents('http://google.com') to grab the html of a page. I am looking for a specific html code, for example, "<td class='right_column'>", which the documents contains several times. Is there a way to look through the html grabbed in $content, and grab out all the content of <td class='right_col'>, which i assume would each be an element of an array!??!?!?!?!? thanks!!!! Quote Link to comment Share on other sites More sharing options...
Festy Posted March 25, 2009 Share Posted March 25, 2009 You can use regular expressions to fetch the data inside <td> tag. Quote Link to comment Share on other sites More sharing options...
.josh Posted March 25, 2009 Share Posted March 25, 2009 preg_match_all("~<td class='right_column'>.*?</td>~is",$content,$matches); Quote Link to comment 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.