Forum Moderators: coopster
I've got a form where people can upload a limited set of html tags, <code> tags included. I want everything between these to be formatted for on-screen display, using htmlspecialchars(), so people can see the source code.
The PHP is:
preg_replace("/<code>(.?)<\/code>/e", "htmlspecialchars($1)", $html); (where $html is the uplodaed html string)
But it's just not replacing anything at all. If I use (.*?) instead of (.?) it just won't parse.
Can anyone help? :(