微信开发返回验证来源方式代码
<?php $xml = simplexml_load_string($GLOBALS['HTTP_RAW_POST_DATA']);
$arr = array( 'appid'=> (string)$xml->AppId, 'appkey'=>$appkey, 'issubscribe'=> (string)$xml->IsSubscribe, 'noncestr'=> (string)$xml->NonceStr, 'openid'=> (string)$xml->OpenId, 'timestamp'=> (string)$xml->TimeStamp ); $sign = sha1( http_build_query($arr) ); if( $sign == $xml->AppSignature){ echo "success"; } ?>
生命只有一次。