If you use the htmlspecialchars() function, it would make the PHP code useless, but it would still be there.
You could use a regex to strip php code like this:
$string = htmlspecialchars($string)
$string = ereg_replace( "(<😉(\?)(php)(.|\n)*(\?)(>😉", "", $string);
(I didn't test the regex, so it may have errors in it)