I'm trying to strip hidden control chars (especially \x{89} and \x{88}) with preg_replace() from a string. It is "ˆText" (it starts with an "\x{88}" char), mb_detect_encoding says it is UTF-8.
The code used is $result = preg_replace('/\x{88}/u','',$string);
but the result is null.
If I use the code without /u modifier I get "�Text", the control char is replaced with a replacement char (U+FFFD).
I'm using PHP 7.1 on Windows. The same search with BBEdit and NotePad++ replaces the chars correctly.
Any ideas?
Thanks, A.