Hi I got an error on an old project which is using cURL and preg match to get the table contents. This is a taken part of a loop. so Its best to use preg_match to adapt the old codes. I have issues extracting the content. The columns is 12 but it failed to extract. Please help.
Thanks.
HTML :
<table><tr>
//looping rows
<td align="center"><input type='checkbox' name="arr[]" value="17700002186"></td>
<input type='hidden' name="table_rg_17700002186" value="rg">
<input type='hidden' name="rg_id_17700002186" value="17700002186">
<input type='hidden' name="rg_uid_17700002186" value="18000174">
<input type='hidden' name="rg_date_17700002186" value="2014-08-22 12:11:37">
<td align="left">1 </td>
<td>ADMIN1 </td>
<td>2014-08-22 12:11:37</td>
<td> <a href="javascript:void(0);" onclick="window.open('http://www.testing.net/rg/popup/1/ADMIN1/1','','toolbar=1,status=1,location=1,scrollbars=1,resizable=1,width=1000,height=500,left='+(screen.availWidth/2-500)+',top='+(screen.availHeight/2-250)+'');"> Rgst </a></td>
<td>TESTING</td>
<td>BA</td>
<td>From : TESTING_<BR>
To: TEST1<BR>(873-021-0435,22-08-2014) </td>
<td align="right" style="padding-right:20px;">251,515</td>
<td align="right" style="padding-right:20px;"> 251515</td>
<td align="right" style="padding-right:20px;">0</td>
<td><textarea wrap="VIRTUAL" name="keter_17700002186" cols="10" row="2"></textarea></td>
// end of looped rows
</tr>
//---------UPDATED HTML:-------------
<tr>
<td colspan="4" align=right>
<input type="submit" class="button" value="Accept" name="sbm"/></td>
<td colspan="4" align=right>
<input type="submit" class="button" value="Reject" name="sbm"/></td>
<td colspan="4">
<input type="submit" class="button" value="Delete" name="sbm"/>
</td>
</tr>
</tbody>
<tfoot>
<tr>
<td colspan="12">
<div style="float:right;"></div>
Total Record: <b>1</b>
</td>
</tr>
</tfoot>
</table>
//---------UPDATED HTML:-------------
Preg_match:
preg_match('/\
.*\<td(.*)<\/td>
.*\<td(.*)<\/td>
.*\<td(.*)<\/td>
.*\<td(.*)<\/td>
.*\<td(.*)<\/td>
.*\<td(.*)<\/td>
.*\<td(.*)<\/td>
.*\<td(.*)<\/td>
.*\<td(.*)<\/td>
.*\<td(.*)<\/td>
.*\<td(.*)<\/td>
.*\<td(.*)<\/td>
/simU',$html,$matches);
var_dump($matches); //array{}