I am not able to decode this JSON response into PHP using json_decode, your help is appreciated:
JSON response from API
{
"fixtures": [
{
"id": 59757,
"home_team_id": 24,
"away_team_id": 18,
"home_score_penalties": 0,
"away_score_penalties": 0,
"formation": {
"home": null,
"away": null
},
"date_time_tba": false,
"spectators": null,
"round_id": 4839
}
]
}
PHP:
$url = "https://api....";
$data = json_decode(file_get_contents($url), true);
echo $data['fixtures'][0]['home_team_id'];
echo $data['formation'][0]['home'];
I get no result!
thank you.