Нашел решение спасибо всем
$str = file_get_contents("
http://example.com/getInfo");
// This will remove unwanted characters.
// Check
http://www.php.net/chr for details
for ($i = 0; $i <= 31; ++$i) {
$str = str_replace(chr($i), "", $str);
}
$str = str_replace(chr(127), "", $str);
// 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 the first 3 characters
if (0 === strpos(bin2hex($str), 'efbbbf')) {
$str = substr($str, 3);
}
$str = json_decode( $str );
print_r($str);