Search the Community
Showing results for tags 'strip tags'.
Found 1 result
No Success In Removing <P> </p>
matthewtbaker posted a topic in PHP Coding HelpHi, I've been trying to remove a suborn <p> </p> which sometimes appears at the bottom of a database entry after the CMS in use strips out 'unsafe' HTML. The value returned from my SQL string is: (8, 'Title', 'Alias', '', '<p>My Paragraph</p>\r\n<p> </p>', '', 1); I've tried removing the unwanted <p> </p> using the code and find variations below, but still no success. $myIntro= $db->intro; $find = array('<p></p>','<p> </p>','<p> </p>',' ','\n'); $myIntro = str_ireplace($find,'', $myIntro); Does anyone have any other approaches to try and strip this out from my string? I can't dump all <p> tags as I still need the rest for formatting. Many thanks Matt