SaMike Posted May 3, 2010 Share Posted May 3, 2010 Hi, i'd like to delete all parts like this from my string: <td class="vertTh"> blahblahbalbhalbha </td> So i want to delete everything that is between <td class="vertTh"> and </td>. There's multiple of these in string (the amount may vary). Example: if my string would be HI!<br> My name is Peter!<br> <td class="vertTh"> bloabfsdff </td> I'm a cat!<br /> <td class="vertTh"> asdadsadasdasdas dafmauahahahahahaa </td> being cat is fun! Would come: HI!<br> My name is Peter!<br> I'm a cat!<br> Being cat is fun! How would i achieve this? Quote Link to comment Share on other sites More sharing options...
Ken2k7 Posted May 3, 2010 Share Posted May 3, 2010 Well, if you want to hide it, you can just use a simple CSS rule. Otherwise, you can use: preg_replace('#<td class="vertTh">.+?</td>#i', '', $str); Quote Link to comment Share on other sites More sharing options...
siric Posted May 3, 2010 Share Posted May 3, 2010 Have a look at this thread. http://www.phpfreaks.com/forums/index.php/topic,296528.msg1404407.html#msg1404407 Quote Link to comment 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.