remove

2 minutes read
If you want to strip line feeds, carriage returns, and tabs you can use: $string = preg_replace('/[\x00-\x1F\x80-\x9F]/u', '', $string); 1 $string = preg_replace('/[\x00-\x1F\x80-\x9F]/u', '', $string);   =>Note that you must use single quotes for the above two examples. If you want to strip everything except basic printable ASCII characters (all the example characters above will be s...