- hash: documentation ( source)
- strtotime: documentation ( source)
- gmdate: documentation ( source)
<?php
$appId = "16536";
$secret= "4ee6a4c96fd141999100f5d78b3b2dba";
$userid = null;
$time = gmdate("Y-m-d\TH:i:s");
$unixTime = @strtotime($time."Z");
$signature = hash('sha256', ($userid?$userid:"").$appId.$unixTime.$secret);
echo "/auth/get-token?appId={$appId}".($userid?"&userid={$userid}":"")."×tamp={$time}&signature={$signature}";
echo "\n\n";
$token = "5642153_16536_253402300799_1_32c40c26408f0f65859d5dd2694e6958e51f7a2cb9fd0399688f21b4c607249f";
echo "&token=" .$token ."&hash=" .hash('sha256', $token .$secret);