我很难用这个等式让它返回正确的值。根据 Steam 的说法,等式Steam_community_number = (Last_part_of_steam_id * 2) + 76561197960265728 + Second_to_last_part_of_steam_id
应该返回 64 位 Steam 社区 ID。目前,这个方程正在返回7.6561198012096E+16
。方程应该返回76561198012095632
,它在某种程度上与它已经返回的几乎相同。我如何将返回的 E+16 值转换为上面我在下面的代码中所述的正确值?谢谢。
function convertSID($steamid) {
if ($steamid == null) { return false; }
//STEAM_X:Y:Z
//W=Z*2+V+Y
//Z, V, Y
//Steam_community_number = (Last_part_of_steam_id * 2) + 76561197960265728 + Second_to_last_part_of_steam_id
if (strpos($steamid, ":1:")) {
$Y = 1;
} else {
$Y = 0;
}
$Z = substr($steamid, 10);
$Z = (int)$Z;
echo "Z: " . $Z . "</br>";
$cid = ($Z * 2) + 76561197960265728 + $Y;
echo "Equation: (" . $Z . " * 2) + 76561197960265728 + " . $Y . "<br/>";
return (string)$cid;
}
我正在调用这个函数$cid = convertSID("STEAM_0:0:25914952");
如果您想查看输出示例,请在此处查看:http: //joshua-ferrara.com/hkggateway/sidtester.php