不错的示例,谢谢博主,我拿去参考了。
<?php //验证签名 if ($_REQUEST['sign'] != Createsign()){ echo '无效签名'; }else{ echo '签名正常'; } //创建签名 function Createsign(){ $str = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz1234567890'; $sign = ''; /*打乱字符串 $randStr = str_shuffle($str); $substr = ubstr($randStr,0,12); */ $substr = substr($str,0,12); return md5(md5($substr).md5($sign)); }