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