I have html of a webpage in a php string, that has, among other things, a table. The table has many rows, out of which I want to extract information about two rows, class.day and class.odd. Each of them are getting repeated multiple times.
I want to have the information in an array out of this, something like (or maybe in an associative array) :
$array1 = array(17=>'', 18=>'', 19=>150, 20=>145, 21=>175)
$array2 = array(17=>'', 18=>'', 19=>90, 20=>75, 21=>120)
$array3 = array(...)
$array4 = array(...)
I was wondering how can I achieve that, can anyone help with any suggestion ?
Thanks a lot.
<table class="matrix">
<tr ...></tr>
<tr ...></tr>
<tr class="day">
<td class="fill_row" colspan="2"></td>
<td class="past">17</td>
<td class="past">18</td>
<td>19</td>
<td>20</td>
<td>21</td>
</tr>
<tr ...></tr>
<tr ...></tr>
<tr class="odd">
<td class="fill_row" colspan="2"></td>
<td class="past"> </td>
<td class="past"> </td>
<td>150</td>
<td>145</td>
<td>175</td>
</tr>
<tr ...></tr>
<tr ...></tr>
<tr class="day">
<td class="fill_row" colspan="2"></td>
<td class="past">17</td>
<td class="past">18</td>
<td>19</td>
<td>20</td>
<td>21</td>
</tr>
<tr ...></tr>
<tr ...></tr>
<tr class="odd">
<td class="fill_row" colspan="2"></td>
<td class="past"> </td>
<td class="past"> </td>
<td>90</td>
<td>75</td>
<td>120</td>
</tr>
</table>