playwright Posted June 4, 2010 Share Posted June 4, 2010 I want to remove a div tag with all its content..so far i' m able to remove tags that don't contain any other tags inside..e.g <b>bla bla bla </b>..However the div tag i want to remove is like <div class="" style=""><tag>bla bla...<other tag/>....</tag></div>..any ideas?? Link to comment https://forums.phpfreaks.com/topic/203845-remove-special-tag-and-its-content/ Share on other sites More sharing options...
ignace Posted June 4, 2010 Share Posted June 4, 2010 post your code Link to comment https://forums.phpfreaks.com/topic/203845-remove-special-tag-and-its-content/#findComment-1067635 Share on other sites More sharing options...
playwright Posted June 4, 2010 Author Share Posted June 4, 2010 i just tried something like that preg_replace('/<div class\=[\"]quotation[\"] style=[\"][\"]\>(.*?)<\/div>/si',"", $html); and it works!! is there a better way to do that?? Link to comment https://forums.phpfreaks.com/topic/203845-remove-special-tag-and-its-content/#findComment-1067640 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.