$id = '76561198036414106';
$key = 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx';
$link2 = file_get_contents('http://api.steampowered.com/ISteamUser/GetFriendList/v0001/?key=' . $key . '&steamid=' . $id . '&relationship=friend');
$myarray2 = json_decode($link2, true);
foreach ($myarray2['friendslist']['friends'] as $type) {
echo "<br>id: " . $type['steamid'];
[save this $type['steamid'] into a var, then do a foreach again and save down the next to another variable]
}
How do I save the output that the foreach is outputting to multiple variables? var1, var2, var3 etc until the array is not outputting anything anymore.
What i'm trying to do is that this script will get the community ids of all my friends on steam then I will take those ids and run them through another api call that will get how much my friends have played a certain game in the past 2 weeks. So all I need from this is how I can save all the community ids that the api is outputting and put them all in a separate variable.