Last active
December 29, 2015 19:39
-
-
Save 29942016/7719039 to your computer and use it in GitHub Desktop.
Convert a SteamID to a ID64 or 'Community ID'
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$steamid = $_POST['steamidbutton']; //Retrieves steam ID from textbox on page post | |
$split = explode(":", $steamid); | |
$x = substr($split[0],6,1); | |
$y = $split[1]; | |
$z = $split[2]; | |
//Steams algorithm for creating IDs, more info can be found on steams web api FAQ | |
$NewSteamID = (($z * 2)+$y); | |
//Convert to ID64 by adding finalised $NewSteamId to the base number used by steam | |
$NewSteamID = bcadd($NewSteamID, "76561197960265728", 0); | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment