public static function convertSteamIdToCommunityId($steamId) {
        if($steamId == 'STEAM_ID_LAN' || $steamId == 'BOT') {
            throw new SteamCondenserException("Cannot convert SteamID \"$steamId\" to a community ID.");
        }
        if (preg_match('/^STEAM_[0-1]:[0-1]:[0-9]+$/', $steamId)) {
            $steamId = explode(':', substr($steamId, 8));
            return bcadd($steamId[0] + $steamId[1] * 2, 76561197960265728);
        } elseif (preg_match('/^\[U:[0-1]:[0-9]+\]$/', $steamId)) {
            $steamId = explode(':', substr($steamId, 3, strlen($steamId) - 1));
            return bcadd($steamId[0] + $steamId[1], 76561197960265727);
        } else {
            throw new SteamCondenserException("SteamID \"$steamId\" doesn't have the correct format.");
        }
    }
public static function convertSteamIdToCommunityId($steamId) {
        if($steamId == 'STEAM_ID_LAN' || $steamId == 'BOT') {
            throw new SteamCondenserException("Cannot convert SteamID \"$steamId\" to a community ID.");
        }
        if (preg_match('/^STEAM_[0-1]:[0-1]:[0-9]+$/', $steamId)) {
            $steamId = explode(':', substr($steamId, 8));
            return bcadd($steamId[0] + $steamId[1] * 2, 76561197960265728);
        } elseif (preg_match('/^\[U:[0-1]:[0-9]+\]$/', $steamId)) {
            $steamId = explode(':', substr($steamId, 3, strlen($steamId) - 1));
            return bcadd($steamId[0] + $steamId[1], 76561197960265727);
        } else {
            throw new SteamCondenserException("SteamID \"$steamId\" doesn't have the correct format.");
        }
    }
public static function convertSteamIdToCommunityId ( $ steamId ) { if ( $ steamId == 'STEAM_ID_LAN' || $ steamId == 'BOT' ) { throw new SteamCondenserException ( "Cannot convert SteamID \"$steamId\" to a community ID." ) ; } if ( preg_match ( '/^STEAM_[0-1]:[0-1]:[0-9]+$/' , $ steamId ) ) { $ steamId = explode ( ':' , substr ( $ steamId , 8 ) ) ; return bcadd ( $ steamId [ 0 ] + $ steamId [ 1 ] * 2 , 76561197960265728 ) ; } elseif ( preg_match ( '/^\[U:[0-1]:[0-9]+\]$/' , $ steamId ) ) { $ steamId = explode ( ':' , substr ( $ steamId , 3 , strlen ( $ steamId ) - 1 ) ) ; return bcadd ( $ steamId [ 0 ] + $ steamId [ 1 ] , 76561197960265727 ) ; } else { throw new SteamCondenserException ( "SteamID \"$steamId\" doesn't have the correct format." ) ; } }
Converts a SteamID as reported by game servers to a 64bit numeric
SteamID as used by the Steam Community

@param string $steamId The SteamID string as used on servers, like
<var>STEAM_0:0:12345</var>
@return string The converted 64bit numeric SteamID
@throws SteamCondenserException if the SteamID doesn't have the correct
format
Converts a SteamID as reported by game servers to a 64bit numeric SteamID as used by the Steam Community