([0-9]*)<\/strong>/', $site, $matches); $online_otservlist = $matches[1]; } catch(Exception $e) {} $online_discord = 0; try { $online_discord = json_decode(file_get_contents("https://discordapp.com/api/guilds/628769144925585428/widget.json"))->presence_count; } catch(Exception $e) {} $response = array( "online" => "$online_otservlist Players online", "discord_online" => $online_discord, "discord_link" => "https://discord.gg/t4ntS5p" ); echo json_encode($response); ?>