- 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 = "0_16536_1408876677_2_f6847bcf07edd672b38a30676808d2bfb97e1f0e3c58addb91a33e3df7567aac";
echo "&token=" .$token ."&hash=" .hash('sha256', $token .$secret);