Remove special characters that mess with formating
20:26 14 Aug 2015

I am currently creating a chat and can't seem to find a way to stop users from posting special characters that mess with formatting of the chat and lagging end users out of the chat.

I am basically trying to remove them entirely. I know the code I have right now "technically if it worked" should only replace them, however I was just trying to get this to work first.

Here is the code that I am using to censor/scrape the variables. I thought htmlentities() would do it but does not seem to be working properly.

            $message = $censor->censorString(
            $this->parseUrls(
                htmlentities(
                    strip_tags(
                        $message)
                )
            )
        ); //Stripping $message of profanity, html tags, and special characters

Here is a screenshot of my problem: enter image description here

php html zalgo