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!!!! Link to comment https://forums.phpfreaks.com/topic/150992-solved-analzye-html-using-file_get_contents/ 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. Link to comment https://forums.phpfreaks.com/topic/150992-solved-analzye-html-using-file_get_contents/#findComment-793333 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); Link to comment https://forums.phpfreaks.com/topic/150992-solved-analzye-html-using-file_get_contents/#findComment-793335 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.