I am in the middle of trying to code a comment form.
I was thinking of using strstr to find if <pre>
exists and if it does turn everything within it into html safe using htmlentities.
But I am coming into a problem of actually converting everything within the pre.
My code becomes true but how to replace.
I was looking at preg_replace but my regex is really poor at best :)
Example:
$string = 'This is a form with <pre>Everything in this needs to be htmlentities() </pre> and everything outside needs to be normal.';