0

I am trying to remove a unicode char but nothing works for me at the moment. The value's come from an Excelsheet that I'm reading. It's the first unicode char from the last value in the array I'm trying to remove. But still haven't got it to work any help would be great.

The value's:

["\u00d81-39","\u00d840-110","\u009d\u00d8111-160"]

I tried:

$value = str_replace(chr(157),"",$value);
$value = str_replace("\u009d","",$value);
$value = preg_replace('/\\\\u[0-9A-F]{4}/i','',$value);
$value = preg_replace('/\\\\u[009d]{4}/i','',$value);
Iason
  • 372
  • 1
  • 5
  • 20

1 Answers1

0

You should look at the answers on Unicode character in PHP string

Try this:

$value = json_decode('"'.$value.'"');

Arjun Kariyadan
  • 489
  • 2
  • 12