The only thing i thought of was this trying to make this code work:
$index = [$player]['matchHistory'][$matchIndex];
$players . $index . ['platformId'];
Trying to get this final outcome
$players[$playerIndex]['matchHistory'][$matchIndex]['platformId'];
But with this code, i get this error
Fatal error: Assignments can only happen to writable values in C:\Users\elvarp\Documents\webdev\iceleague\testing.php on line 39
Is this possible in php? Don't have enough knowledge to google this around.
EDIT: Full code i'm working with:
foreach ($players as $playerIndex => $player) {
$matchHistory = $api->getRecentMatchList($player['summonerAccountId'], "season=9");
foreach ($matchHistory['matches'] as $matchIndex => $match) {
$index = [$playerIndex]['matchHistory'][$matchIndex];
$players . $index . ['platformId'] = $match['platformId'];
$players . $index . ['matchId'] = $match['gameId'];
$players . $index . ['championId'] = $match['champion'];
$players . $index . ['queue'] = $match['queue'];
$players . $index . ['season'] = $match['season'];
$players . $index . ['timestamp'] = $match['timestamp'];
$players . $index . ['role'] = $match['role'];
$players . $index . ['lane'] = $match['lane'];
}
}
The value of $player
Array
(
[summonerName] => Retro
[summonerId] => 27467980
[summonerAccountId] => 31905356
)