我正在使用Football-data API从API发布即将发布的灯具。
div
我只想输出utcDate,homeTeam,客队和舞台结果以创建即将发布的灯具列表。当我回显/打印它时,在$ matches ['utcDate']抛出错误时,正在努力引用这些值。
这是我选择print_r($ value)时输出的内容
<h3>Forthcoming Fixtures</h3>
<?php
$uri = 'http://api.football-data.org/v2/teams/308/matches?status=SCHEDULED';
$reqPrefs['http']['method'] = 'GET';
$reqPrefs['http']['header'] = 'X-Auth-Token:'.$api_key;
$stream_context = stream_context_create($reqPrefs);
$response = file_get_contents($uri, false, $stream_context);
$matches = json_decode($response);
foreach ($matches as $key => $value) {
print_r($value);
echo "<br>";
}