侃侃尔雅
function encryptTokey($data){$apikey = 'testapikey111';$ps1 = sha1($apikey . strtolower($data));$ps1 = strtoupper($ps1);$s1 = implode(str_split($ps1, 2), '-');$ps2 = md5($s1 . $apikey);$ps2 = strtoupper($ps2);$token = implode(str_split($ps2, 2), '-');return $token;}echo encryptTokey('testdata');运行结果:68-10-98-74-4C-82-74-4B-CC-49-31-98-46-02-EE-8E