PHP: How to remove non-printable characters from strings
By Alvin Alexander. Last updated: July 14 2019
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.