Hi,
I am using cURL to grab the contents of a webpage which contains a table. I am trying to make an array out of the table contents, with the column headings as the array keys. Unfortunately the first row of the table, before the headers, has pagination which is messing it all up. The row in question is as follows:
<tr class="DGListPager" align="center">
<td colspan="6"><b>Page: </b><span>1</span> <a href="javascript:__doPostBack('ctl00$oCPH1$dgHistory$ctl01$ctl01','')">2</a> <a href="javascript:__doPostBack('ctl00$oCPH1$dgHistory$ctl01$ctl02','')">3</a> <a href="javascript:__doPostBack('ctl00$oCPH1$dgHistory$ctl01$ctl03','')">4</a> <a href="javascript:__doPostBack('ctl00$oCPH1$dgHistory$ctl01$ctl04','')">5</a> <a href="javascript:__doPostBack('ctl00$oCPH1$dgHistory$ctl01$ctl05','')">6</a> <a href="javascript:__doPostBack('ctl00$oCPH1$dgHistory$ctl01$ctl06','')">7</a> <a href="javascript:__doPostBack('ctl00$oCPH1$dgHistory$ctl01$ctl07','')">8</a></td>
</tr>
I have tried using preg_replace and preg_filter to simply get rid of the extra row, but I haven't had any luck. I am afraid that my regex skill is sub-par. My best attempt is below:
preg_replace('/<tr class="DGListPager" align="center">(.*?)<\/tr>/', '', $output)
If anyone could point me in the right direction here, ti would be a great help. Thanks