- hash: documentation ( source)
- strtotime: documentation ( source)
- gmdate: documentation ( source)
<?php
$appId = "11325";
$secret= "52b0c70dc9244762b762d6554116d32f";
$userid = "12405620";
$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 = "0_11325_1408876902_2_897854c64a49b08adec644684493be101531d6e3481b3bc52419fc025327a349";
echo "&token=" .$token ."&hash=" .hash('sha256', $token .$secret);