<?php
$json = file_get_contents("https://api.twitch.tv/kraken/streams");
$elements = json_decode($json,true);
foreach ($elements as $element) {
$channel = get_object_vars($element);
print_r(array_keys($channel));
}
?>
错误:
get_object_vars() 期望参数 1 是对象,数组在第 10 行的 /home/xzer123/public_html/tw1.php 中给出
array_keys() 期望参数 1 是数组,在第 11 行的 /home/xzer123/public_html/tw1.php 中给出 null
怎么了?