This python.org page has a nice discussion on Unicode and the history of character codes. It’s good background material in case you ever wondered how we got where we are, and how character codes work on computers.
PHP FAQ: How do I remove all non-printable characters from a string in PHP?
I don’t know of any built-in PHP functions to remove all non-printable characters from a string, so the solution is to use the
preg_replace function with an appropriate regular expression.