0
我有以下的PHP代码来从蒸汽web api得到一个json文件。我似乎无法弄清楚为什么这没有收到任何信息。任何帮助,将不胜感激。使用PHP,请求蒸汽API调用解决虚荣名称,不起作用
请使用您自己的蒸汽API键。
<!DOCTYPE html>
<html>
<head>
<title>Test</title>
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
</head>
<body>
<p>Welcome! <?php echo $_GET["fname"]; ?></p>
<p>Your steam id is
<?php
$username = $_GET["fname"];
$devKey = '<Insert Dev Key>';
$json_url = 'http://api.steampowered.com/ISteamUser/ResolveVanityURL/v0001/?key=' . $devKey . '&vanityurl=' . $username;
echo $json_url;
$json_output = json_decode ($json_url, true);
echo $json_output['response']['steamid'];
?>
</p>
</body>
</html>
呃....我的大脑真的在深层。非常感谢你,我一定会考虑卷曲。 – ThreeFold
@ user1449940没问题。很高兴我能帮上忙。 – Jim