\xe2\x80\x93 python code example Example: \x00-\x1F\x80-\x9F $string = preg_replace('/[\x00-\x1F\x7F]/u', '', $string);