Last active
June 7, 2017 23:04
-
-
Save xhat/371b8caac1d9d5b280cb545e83c7d79b to your computer and use it in GitHub Desktop.
payjs.cn签名方法
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* 签名方法: | |
* 1.把所有参数根据参数名首字母asc码排序 | |
* 2.以键值 http querystring 方式连接 | |
* 3.取md5值转化为大写 | |
*/ | |
function sign(array $data) | |
{ | |
$key = '21341234124312344'; | |
ksort($data); | |
$sign = strtoupper(md5(urldecode(http_build_query($data)).'&key='.$key)); | |
return $sign; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment