生成微信支付签名sign以微信提供的数据库为例
$key = "192006250b4c09247ec02edce69f6a2d";
$array = [
'appid'=>'wxd930ea5d5a258f4f',
'mch_id'=>'10000100',
'device_info'=>'1000',
'body'=>'test',
'nonce_str'=>'ibuaiVcKdpRxkhJA'
];
ksort($array); //排序
$str = urldecode(http_build_query($array)).'&key='.$key ; //生成字符串
$sign = strtoupper(md5($str));
$sign 结果和https://pay.weixin.qq.com/wiki/doc/api/jsapi.php?chapter=4_3微信提供的生成sign一致
"9A0A8659F005D6984697E2CA0A9CF3B7"

浙公网安备 33010602011771号