我想在 JSON 数据中获取游戏的 id、competitionId、competitionDisplayName。我当前的代码没有输出任何内容,谁能告诉我我做错了什么。谢谢
$json_string = 'https://webws.365scores.com/web/games/?langId=27&timezoneName=Asia/Hebron&userCountryId=-1&appTypeId=5&sports=1&startDate=17/08/2019&endDate=17/08/2019';
$json = file_get_contents($json_string);
$array = json_decode($json);
foreach($array as $values)
{
$output = $values->games['competitionDisplayName'] . "\n";
}
echo $output;
偶然的你
手掌心