I'm a novice programmer and I'm a bit lost rigth now. I would like to get the data from "gameId" and save it into a variable.
printing $recentgames:
print_r($recentgames);
returns me this:
stdClass Object (
[summonerId] => 40300606,
[games] => Array (
[0] => stdClass Object (
[gameId] => 2102575613 ...
I want to store "2102575613" into $gamesid
. But my code does not work.
$gamesid = $recentgames->array[0]->gameId;
//I have also tried this code
$gamesid = $recentgames->object->games->array[0]->gameId;
//and this one
$gamesid = $recentgames->$object->$games->$array[0]->gameId;
Any help would be highly appreciated.