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? Quote Link to comment 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> Quote Link to comment 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. 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.