I've got an HTML Table: <table> <tr class="table-header"> <td>Header 1</td> <td>Header 2</td> </tr> <tr class="table-content"> <td>Data Content 1</td> <td>Data Content 2</td> </tr> <!-- This table-content row repeats multiple times depending on records returned --> </table> HTML: Now, what I'm trying to do is use preg_match_all to return all the rows that start with "<tr class="table-content">" and place each row into an array. I'm having some trouble coming up with the RegEx Pattern, anyone think them might be able to help out. I've been able to match the starting string using "<tr class="table-content"> as the regex pattern, but I'm getting a bit confused on how to match the whole row. The characters between the opening <tr> and closing </tr> tag can be anything.
preg_match_all("/<tr class=\"table-content\">(.*?)<\/tr>/si", $html, $table_content, PREG_PATTERN_ORDER); PHP: Assuming the HTML is $html, the above should work.. $table_content will be the array. (The array values will still have HTML in them).