siddscool19 Posted September 13, 2008 Share Posted September 13, 2008 Hey people <td valign="top" class="maintab_back"> <a href="http://www.phpfreaks.com/forums/index.php?action=help">Help</a> </td> <td valign="top" class="maintab_back"> <a href="http://www.phpfreaks.com/forums/index.php?action=search">Search</a> </td> <td valign="top" class="maintab_back"> <a href="http://www.phpfreaks.com/forums/index.php?action=profile">Profile</a> </td> <td valign="top" class="maintab_back"> <a href="http://www.phpfreaks.com/forums/index.php?action=pm">My Messages </a> </td> <td valign="top" class="maintab_back"> <a href="http://www.phpfreaks.com/forums/index.php?action=calendar">Calendar</a> </td> <td valign="top" class="maintab_back"> <a href="http://www.phpfreaks.com/forums/index.php?action=mlist">Members</a> </td><td valign="top" class="maintab_back"><a href="/page/forum-rules">Rules</a></td> <td valign="top" class="maintab_back"> <a href="http://www.phpfreaks.com/forums/index.php?action=staff">Staff List</a> Now i want to get data between <td valign="top" class="maintab_back"> and Staff List</a> using preg_match. I used this coding The above data is stored in variable $data preg_match('<td valign="top" class="maintab_back">(.*)Staff List<\/a>/',$data,$newdata); echo $newdata[1]; But I am not getting any output so what to do? Quote Link to comment https://forums.phpfreaks.com/topic/124035-how-to-get-multiple-paragraphs-using-preg_match/ Share on other sites More sharing options...
teng84 Posted September 13, 2008 Share Posted September 13, 2008 better to just use explode $foo = explode('<td valign="top" class="maintab_back">', $string); foreach($foo as $val){ echo strip_tags($val); } not tested but should do the trick Quote Link to comment https://forums.phpfreaks.com/topic/124035-how-to-get-multiple-paragraphs-using-preg_match/#findComment-640352 Share on other sites More sharing options...
sasa Posted September 13, 2008 Share Posted September 13, 2008 preg_match('/<td valign="top" class="maintab_back">(.*)Staff List<\/a>/s',$data,$newdata); echo $newdata[1]; Quote Link to comment https://forums.phpfreaks.com/topic/124035-how-to-get-multiple-paragraphs-using-preg_match/#findComment-640359 Share on other sites More sharing options...
teng84 Posted September 13, 2008 Share Posted September 13, 2008 sry ignore my post ! wrong interpretation Quote Link to comment https://forums.phpfreaks.com/topic/124035-how-to-get-multiple-paragraphs-using-preg_match/#findComment-640362 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.