I'm working on a PHP script and I want it to fetch this from steam api: Steam api example
This is my code so far:
<!DOCTYPE html>
<html>
<head>
<title>
Test
</title>
</head>
<body style="text-align:center;">
<form method="post">
<input type="submit" value="OK" name="kk"/>
</form>
<?php
if(isset($_POST['kk'])) {
$json = file_get_contents('https://api.steampowered.com/ICSGOServers_730/GetGameServersStatus/v1/?key=STEAM API KEY HERE');
$obj = json_decode($json);
echo $obj->result;
}
?>
</head>
</html>
How can I fetch it?
file_get_contents, does it notfetchthe json response (like in the image). If not what are the errors - endeavourvar_dump($object)and take a look at the contents. Obviously you replacedkey=STEAM API KEY HEREwith your actual api key... - Kisaragi