August 12th, 2000, 11:52 PM
i want to set up a forum type script and i want to be able to strips html tags that people may use. how do i do this in php?
i'd also like to strip out profanity and replace it with a * or something like that. i assume this will be done the same way as above.
thanks in advance!!!
August 13th, 2000, 12:18 AM
use htmlspecialchars() to make html input "safe"
i don't think that php has a built-in profanity stripping function, so i would suggest just using a regular expression or two to replace the words that you don't want to appear
<BLOCKQUOTE><font size="1" face="Verdana,Arial,Helvetica">code:</font><HR><pre>$variableName = preg_replace("/s(profanity1|profanity2|profanityX)s/i", "****", $variableName);[/code]
[This message has been edited by RyanP (edited August 13, 2000).]
August 13th, 2000, 12:45 PM
fantastic, thanks ryanp!!!!