I have many characters in a text / json like:
\xea = ê
\xaa = ª (I think)
How convert to correct character in PHP?
Thanks a lot.
I have many characters in a text / json like:
\xea = ê
\xaa = ª (I think)
How convert to correct character in PHP?
Thanks a lot.
You could try something like this:
$text = preg_replace_callback('/\\\\x([0-9a-fA-F]{2})/', function ($matches) { return chr(hexdec($matches[1])); },$text);
Edit: Sorry, I just copy/pasted an old code - the e
modifier is deprecated.