Так что я этот следующий код:Объект класса StdClass не может быть преобразован в строку с Halo API
<?PHP
$remote_url = 'https://www.haloapi.com/stats/h5/players/PLAYER/matches';
// Create a stream
$opts = array(
'http'=>array(
'method'=>"GET",
'header' => "Ocp-Apim-Subscription-Key: MY SUBSCRIPTION KEY")
);
$context = stream_context_create($opts);
// Open the file using the HTTP headers set above
$file = file_get_contents($remote_url, false, $context);
print(json_decode($file));
?>
, и это дает мне следующую ошибку:
Catchable Фатальная ошибка: Объект класса StdClass не удалось преобразовать в строку в C: \ xampp \ htdocs \ HaloAPItest \ index.php в строке 17
Что мне делать?
Вы ищете 'print_r()', а не 'print()'. – Darren