So, i'm making a forum and need to do a few things to the string stored in the variable $body. How would I go about doing this?
A) Not strip, but make where all the HTML/PHP/Javascript/CSS/etc. doesn't work. Like, that way people could share code but it wouldn't execute. Someone suggested using a command like htmlentities($body) (I forgot what it was called) but that didn't work.
B) Spacing. For new lines, i use nl2br($body). I dunno how to explain it, but say the user typed a string like this:
this
(5 spaces here) is
(10 spaces here) an
(5 spaces here) example
(5 spaces here) string
(2 spaces here) =)
I know the above ^^ is a bad example, but idk how to explain it XD
It would output as (using nl2br):
this
is
an
example
string
=)
C) A censor. Basically, take a wordlist, like say I had a file called badwords.txt containing:
stupid
noob
hacks
omg
It would put them into an array, then if any of the words were found in the string die an error?
thx in advance :)