foreach ($lines as $usernumber) { // Loops line by line
$link = 'http://api.steampowered.com/IPlayerService/GetOwnedGames/v0001/?key=' . $api_key . '&steamid=' . $usernumber . '&format=json';
$json = file_get_contents($link); // Reads link (this ^)
$data = json_decode($json); // Defines decode as json
if (!empty($data->response->games)) {
foreach ($data->response->games as $game) { // loops through the array
if ($game->appid == $game_id) { // Reads GameID above (consider removing $var)
$playtime = $game->playtime_forever; // looks for steam API playtime_forever
if (($playtime < 5940) && ($playtime > 1)) { // Defines the minimum playtime (5940/60=99min)
$fh = fopen("final." . $timestamp . ".txt", 'a') or die("can't open file"); // Opens final.txt to write in
fwrite($fh, $usernumber); // Writes the parsed results to final.txt
} //closes if $playtime
} //closes if $game
} //closes foreach $data
} //closes if !empty
else {echo '.'; }
} //closes foreach $lines