There's a html table assigned to a variable $text. (The table can have different number of rows)
What would be the easiest way to get rid of the rows that do not have a value in column 2 (in this example it would be row 2)
Example:
$text = <<<EOT
<table style="width: 430px;">
<tbody>
<tr>
<td style="width: 199px;"><b>Row 1:</b></b></td>
<td style="width: 413px;">6754</td>
</tr>
<tr>
<td style="width: 199px;"><b>Row 2:</b></td>
<td style="width: 413px;"></td>
</tr>
<tr>
<td style="width: 199px;"><b>Row 3</b></td>
<td style="width: 413px;">7567</td>
</tr>
</tbody>
</table>
EOT;
Expected result:
$text = <<<EOT
<table style="width: 430px;">
<tbody>
<tr>
<td style="width: 199px;"><b>Row 1:</b></b></td>
<td style="width: 413px;">6754</td>
</tr>
<tr>
<td style="width: 199px;"><b>Row 3</b></td>
<td style="width: 413px;">7567</td>
</tr>
</tbody>
</table>
EOT;