Using regex to strip out certain data from HTML code via PHP
- by Chris
I have the following HTML snippet
<tr>
<td class="1">...</td>
<td class="2">...</td>
<td class="3">...</td>
<td class="4">...</td>
</tr>
etc...
I basically have N rows, and each row contains 4 TD's each with a unique class.
I would like a simple way to split out all the rows and TD's by class so I can choose what data I want to use.
I expect the easiest way to achieve this would be regex (maybe two). One to split up the TR's then another to split up the TDs (by class preferably)
Thanks