Let assume that $reply = “blah blah blah >< blah blah blah”;
(>< is popular emoticon in korea)
but, when i use “strip_tags” to strip every html and php tags in $reply, every characters after “<” is removed.
i think strip_tags mixed up.
is there any solution to solve this problem?
You’re treating the string as HTML if you are calling
strip_tags()on it. Therefore, those entities should be encoded as<and>before you usestrip_tags()on it, otherwise they are to be treated as the start and end of HTML tags.You will need to encode those entities. Using
strip_tags()should then be safe.