Norsk.Firefox Posted October 3, 2007 Share Posted October 3, 2007 Hello How can I strip all HTML tags, except a few that I set as allowed? (strip_tags() doesn't work, have to validate attributes and that the tag is closed) Anyone have a function that I might use? Link to comment https://forums.phpfreaks.com/topic/71657-strip-html-byt-allow-some/ Share on other sites More sharing options...
jaymc Posted October 3, 2007 Share Posted October 3, 2007 I think strip_tags($string, '<BR>', '<p>'); That will allow the use of <BR> and <p> Link to comment https://forums.phpfreaks.com/topic/71657-strip-html-byt-allow-some/#findComment-360770 Share on other sites More sharing options...
Norsk.Firefox Posted October 3, 2007 Author Share Posted October 3, 2007 Yes, but as i mentioned above; the strip_tags function doesn't work cause it doesn't validate attributes, not if the tag is closed ether. Link to comment https://forums.phpfreaks.com/topic/71657-strip-html-byt-allow-some/#findComment-360779 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.