ravi181229 Posted December 8, 2008 Share Posted December 8, 2008 Hi, I would like to parse the html code and get the data between <table border="0" cellspacing="0" cellpadding="2" class="ysprow1" width="100%" style="border-collapse: collapse" bordercolor="#111111"> </table> html cdoe: <table border="0" cellspacing="0" cellpadding="2" class="ysprow1" width="100%" style="border-collapse: collapse" bordercolor="#111111"><tr><td class="yspdetailttl" valign="bottom" height="12"> Mon, Dec 8</td></tr><tr><td> <table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="100%"> <tr> <td nowrap> • Kentucky: Big Blue Sports Shows</td> <td nowrap> <span class="yspscores"> <a href="javascript:void(window.open('http://cosmos.bcst.yahoo.com/up/collegetest/?cl=10533242','playerWindow','width=793,height=608,scrollbars=no'));" ><img border="0" src="http://l.yimg.com/a/i/us/sp/ed/ic/free_audio_box.gif" width="16" height="12" alt="Free Audio"></a> </span></td> <td nowrap> </td> <td width="100%" nowrap class="yspscores"> 6:00 pm EST</td> </tr> </table></td></tr> <tr><td> <table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="100%"> <tr> <td nowrap> • Lehigh <span class='yspscores'><a href="javascript:void(window.open('http://cosmos.bcst.yahoo.com/up/collegetest/?cl=10603183','playerWindow','width=793,height=608,scrollbars=no'));" ><img border="0" src="http://l.yimg.com/a/i/us/sp/ed/ic/pay_video_box.gif" width="16" height="12" alt="Subscription Video"></a> </span> vs. Albany <span class='yspscores'></span></td> <td nowrap> </td> <td width="100%" nowrap class="yspscores"> 6:30 pm EST </td> </tr> </table></td></tr> <tr><td> <table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="100%"> <tr> <td nowrap> • Alabama: Hey Coach</td> <td nowrap> <span class="yspscores"> <a href="javascript:void(window.open('http://cosmos.bcst.yahoo.com/up/collegetest/?cl=10201617','playerWindow','width=793,height=608,scrollbars=no'));" ><img border="0" src="http://l.yimg.com/a/i/us/sp/ed/ic/pay_audio_box.gif" width="16" height="12" alt="Subscription Audio"></a> </span></td> <td nowrap> </td> <td width="100%" nowrap class="yspscores"> 7:00 pm EST</td> </tr> </table></td></tr> </table> Need help. Thanks. Quote Link to comment https://forums.phpfreaks.com/topic/136078-solved-parsing-between/ Share on other sites More sharing options...
ravi181229 Posted December 8, 2008 Author Share Posted December 8, 2008 I could finally write the code to get content between <table...>......</table> : $patterns = ' width="100%" style="border-collapse: collapse" bordercolor="#111111"'; $html = str_replace($patterns, "", $html); preg_match_all('~class="ysprow1">(.*)~is',$html,$matches); print_r($matches); Quote Link to comment https://forums.phpfreaks.com/topic/136078-solved-parsing-between/#findComment-709829 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.