factoring2117 Posted August 14, 2010 Share Posted August 14, 2010 Hey guys, Here is the html code that I need to get data from: <tr> <td height=25 width=90 class=TB-header> Loan #</td> <td height=25 width=90 class=TB-header>Borrower Name</td> <td height=25 width=60 class=TB-header>Due Date</td> <td height=25 width=55 class=TB-header>Status</td> <td height=25 width=75 class=TB-header>Tracking No.</td> <td height=25 width=60 class=TB-header>Appt. Set</td> <td height=25 width=45 class=TB-header align=right>Fee</td> <td height=25 width=60 class=TB-header align=right>Payment</td> <td height=25 width=55 class=TB-header align=right>Balance </td> </tr> <tr> <td height=25 class="Pending"><a href="javascript:NotesWindow('Lxxx 4013')"; class="Loan_Pending">xxx 4013</a></td> <td height=25 class="Pending">Loxxxxx, Daniel </td> <td height=25 class="Pending">6/29/2010</td> <td height=25 class="Pending">PENDING</td> <td height=25 class="nav-black"> <a href="http://www.fedex.com/cgi-bin/tracking?action=track&language=english&last_action=alttrack&ascend_header=1&cntry_code=us&initial=x&mps=y&tracknumbers=" target="_blank"></a> </td> <td height=25> <input type="checkbox" checked value="ON"></td> <td height=25 class="nav-black" align=right>$0.00</td> <td height=25 class="nav-black" align=right></td> <td height=25 class="nav-black" align=right></td> </tr> <tr> <td height=25 class="nav-black" colspan=9><strong>Notary: </strong>Sxxxx, Julie </strong> 19061 E Powers Place, Aurora, CO 80015</td> </tr> <tr> <td colspan=9 bgcolor="DarkGray"><img src="images/clear.gif" width="1" height="1" alt="" border="0"></td> </tr> <tr> <td height=25 class="Canceled"><a href="javascript:NotesWindow('Mxxx 3677')"; class="Loan_Canceled">Mxxx 3677</a></td> <td height=25 class="Canceled">Mxxxx, Michael</td> <td height=25 class="Canceled">6/25/2011</td> <td height=25 class="Canceled">CANCELED</td> <td height=25 class="nav-black"> <a href="http://www.fedex.com/cgi-bin/tracking?action=track&language=english&last_action=alttrack&ascend_header=1&cntry_code=us&initial=x&mps=y&tracknumbers=" target="_blank"></a> </td> <td height=25> <input type="checkbox" value="ON"></td> <td height=25 class="nav-black" align=right></td> <td height=25 class="nav-black" align=right></td> <td height=25 class="nav-black" align=right></td> </tr> <tr> <td height=25 class="nav-black" colspan=9><strong>Notary: </strong>Cxxxx Helen-Mitchell </strong> 7646 S. Merrill Ave, Chicago, Il 60649</td> </tr> <tr> <td colspan=9 bgcolor="DarkGray"><img src="images/clear.gif" width="1" height="1" alt="" border="0"></td> </tr> I need to extract each one of these tr sections minus the top one because it is the header of the table. Any ideas? Quote Link to comment https://forums.phpfreaks.com/topic/210713-regex-problem-preg-match-all/ Share on other sites More sharing options...
Psycho Posted August 15, 2010 Share Posted August 15, 2010 Just get ALL the TR sections, then throw the first one away. Assuming the input is in the variable $htmlInput, this should work for you //Get all the TR contents preg_match_all("/<tr[^>]*>(.*?)<\/tr>/ms", $htmlInput, $matches); //Set $trMatches to just the matched content $trMatches = $matches[1]; //Remove the first TR content array_shift($trMatches); //$trMatches will be an array of all the TR content except the first. Quote Link to comment https://forums.phpfreaks.com/topic/210713-regex-problem-preg-match-all/#findComment-1099559 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.