How to remove all non printable characters in a string?
7 bit ASCII? If your Tardis just landed in 1963, and you just want the 7 bit printable ASCII chars, you can rip out everything from 0-31 and 127-255 with this: $string = preg_replace(‘/[\x00-\x1F\x7F-\xFF]/’, ”, $string); It matches anything in range 0-31, 127-255 and removes it. 8 bit extended ASCII? You fell into a Hot … Read more