stdClass Object (
[api] => stdClass Object (
[results] => 1
[leagues] => stdClass Object (
[1] => stdClass Object (
[league_id] => 1
[name] => World Cup
[country] => World
[country_code] =>
[season] => 2018
[season_start] => 2018-06-14
[season_end] => 2018-07-15
[logo] => https://media.api-football.com/leagues/1.png
[flag] =>
[standings] => 1
)
)
)
)
$data= json_decode($response,false);
I must read the element [league_id]
I tried to write
echo $data->api->leagues[1]->league_id;
seeing also the previous examples, but nothing is printed, I can't understand what I'm wrong. Could someone help me, thanks? thanks