Categories
How to remove \ufeff from json string?
There is a json array string ["\ufeff1788","1789","1790"] . How would it be correct to remove \ufeff from it ? I tried this, but it didn't help:$data = preg_replace('/\x{feff}$/u', '', $data);
["\ufeff1788","1789","1790"]
$data = preg_replace('/\x{feff}$/u', '', $data);
Answer the question
In order to leave comments, you need to log in
$data = str_replace('\ufeff', '', $data)
$result = trim($result, "\xEF\xBB\xBF");
Didn't find what you were looking for?
Ask a Question
731 491 924 answers to any question