ted_chou12 Posted October 1, 2010 Share Posted October 1, 2010 Hi, I wish to match tags with self closed slashes and convert them to non self closed: eg. <br /> => <br> <img src="...." height="" .... /> => <img src="..." height="" ...> just replace the last two characters /> to > but they might be in a long text eg... <html> <br /> text.... this is a title page<img src="" height="" /> <table> ... </table> ... Thanks Ted Link to comment https://forums.phpfreaks.com/topic/214955-matching-tags/ Share on other sites More sharing options...
sasa Posted October 2, 2010 Share Posted October 2, 2010 preg_replace('/\s*\/\s*>/', '>', $subject) Link to comment https://forums.phpfreaks.com/topic/214955-matching-tags/#findComment-1118234 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.