utf 8 - PHP: How to remove all non printable characters in a string? - Stack Overflow
Starting with PHP 5.2, we also have access to filter_var, which I have not seen any mention of so thought I'd throw it out there. To use filter_var to strip non-printable characters < 32 and > 127, you can do: Filter ASCII characters below 32 $string = fi...