нашел решение
// This will remove unwanted characters.
for ($i = 0; $i <= 31; ++$i) {
$result = str_replace(chr($i), "", $result);
}
$result = str_replace(chr(127), "", $result);
// This is the most common part
// Some file begins with 'efbbbf' to mark the beginning of the file. (binary level)
// here we detect it and we remove it, basically it's the first 3 characters
if (0 === strpos(bin2hex($result), 'efbbbf')) {
$result = substr($result, 3);
}
$result = json_decode( $result );
print_r($result);