ThinkPHP 5 整合支付宝微信支付(支付宝H5,微信H5、APP支付、公众号支付)

ThinkPHP 5 整合支付宝微信支付(支付宝H5,微信H5、APP支付、公众号支付),第1张

概述因项目没有PC站所以没有写电脑网站支付。 Pay.php支付控制器 模型:Weixin.php Weixin.php Alipay.php 支付宝需要的submit文件:点击下载 wx.html在使用

 Pay.PHP支付控制器

// +----------------------------------------------------------------------<span >use<span > think\Db;
<span >use<span > think\Request;
<span >use<span > think\Session;
<span >use<span > think\cookie;
<span >use<span > app\phone\model\<span >Weixin;
<span >use<span > app\phone\model\<span >Weixin_pay;
<span >use<span > app\phone\model\<span >Alipay;

<span >class Pay <span >extends<span > controller
{
<span >public <span >function<span > _initialize()
{
<span >$this->alipay_config = <span >array<span >(
<span >//<span >应用ID,您的APPID。
'app_ID' => '<span >your app_ID',<span >//<span >支付宝公钥,查看地址:https://openhome.alipay.com/platform/keyManage.htm 对应APPID下的支付宝公钥。
'alipay_public_key' => '<span >your alipay_public_key',<span >//<span >商户私钥,您的原始格式RSA私钥
'merchant_private_key' => '<span >your merchant_private_key',<span >//<span >异步通知地址
'notify_url' => "<span >your notify_url",<span >//<span >同步跳转
'return_url' => "<span >your return_url",<span >//<span >编码格式
'charset' => "UTF-8",<span >//<span >签名方式
'sign_type' => "RSA2",<span >//<span >支付宝网关
'gatewayUrl' => "https://openAPI.alipay.com/gateway.do",<span >//<span >支付宝partner,2088开头数字
'partner' => '<span >your partner',<span >//<span >支付宝密钥
'md5_key' => '<span >your key'<span >
);
<span >$this->wechat_config = <span >array<span >(
<span >//<span >您的APPID
'app_ID' => '<span >your app_ID',<span >//<span >您的md5_key
'md5_key' => '<span >your md5_key',<span >//<span >您的mch_ID
'mch_ID' => '<span >your mch_ID',<span >//<span >您的appsecret
'appsecret' => '<span >your appsecret',<span >//<span >您的回调地址可以在这里配置使用方法的时候传,也可以在模型里面配置。
'notify_url' => '<span >your notify_url',<span >
);
}

</span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #008000"&gt;/*</span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #008000"&gt;微信h5支付 </span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #008000"&gt;*/</span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #0000ff"&gt;pub<a href="https://m.jb51.cc/tag/li/" target="_blank" >li</a>c</span> <span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #0000ff"&gt;function</span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #000000"&gt; wechat_pay(){    </span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #0000ff"&gt;if</span> (<a href="https://m.jb51.cc/tag/input/" target="_blank" >input</a>('post.token') ==<span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #000000"&gt; TOKEN) {        </span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #008000"&gt;//</span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #008000"&gt; 判断<a href="https://www.jb51.cc/tag/yonghu/" target="_blank" >用户</a>是在微信<a href="https://m.jb51.cc/tag/liulanqi/" target="_blank" >浏览器</a>打开还是其他<a href="https://m.jb51.cc/tag/liulanqi/" target="_blank" >浏览器</a>打开。</span>        <span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$userAgent</span> = <span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$_SERVER</span>['<a href="https://m.jb51.cc/tag/http/" target="_blank" >http</a>_USER_AGENT'<span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #000000"&gt;];        </span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #0000ff"&gt;if</span> (<span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #008080"&gt;strpos</span>(<span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$userAgent</span>,'MicroMessenger'<span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #000000"&gt;)) {            </span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$wechat</span> = <span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #0000ff"&gt;new</span> Weixin(<span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$this</span>->wechat_con<a href="https://www.jb51.cc/tag/fig/" target="_blank" >fig</a>['appsecret'],<span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$this</span>->wechat_con<a href="https://www.jb51.cc/tag/fig/" target="_blank" >fig</a>['app_<a href="https://m.jb51.cc/tag/ID/" target="_blank" >ID</a>'<span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #000000"&gt;]);            </span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$wechat_pay</span> = <span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #0000ff"&gt;new</span> Weixin_pay(<span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$this</span>->wechat_con<a href="https://www.jb51.cc/tag/fig/" target="_blank" >fig</a>['appsecret'],<span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$this</span>->wechat_con<a href="https://www.jb51.cc/tag/fig/" target="_blank" >fig</a>['app_<a href="https://m.jb51.cc/tag/ID/" target="_blank" >ID</a>'],<span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$this</span>->wechat_con<a href="https://www.jb51.cc/tag/fig/" target="_blank" >fig</a>['md5_key'],<span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$this</span>->wechat_con<a href="https://www.jb51.cc/tag/fig/" target="_blank" >fig</a>['mch_<a href="https://m.jb51.cc/tag/ID/" target="_blank" >ID</a>'<span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #000000"&gt;]);            </span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$code</span> = <a href="https://m.jb51.cc/tag/input/" target="_blank" >input</a>('post.code'<span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #000000"&gt;);            </span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #0000ff"&gt;if</span> (session::has('open<a href="https://m.jb51.cc/tag/ID/" target="_blank" >ID</a>'<span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #000000"&gt;)) {                </span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$open<a href="https://m.jb51.cc/tag/ID/" target="_blank" >ID</a></span> = session::get('open<a href="https://m.jb51.cc/tag/ID/" target="_blank" >ID</a>'<span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #000000"&gt;);                </span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$total_fee</span> = 1<span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #000000"&gt;;                </span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$out_<a href="https://www.jb51.cc/tag/Trad/" target="_blank" >Trad</a>e_no</span> = '12345678945641231'<span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #000000"&gt;;                </span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$body</span> = "充值金币支付测试"<span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #000000"&gt;;                </span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$res</span> = <span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$wechat_pay</span>->pay(<span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$open<a href="https://m.jb51.cc/tag/ID/" target="_blank" >ID</a></span>,<span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$total_fee</span>,<span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$body</span>,<span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$out_<a href="https://www.jb51.cc/tag/Trad/" target="_blank" >Trad</a>e_no</span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #000000"&gt;);                </span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$arr</span>['errcode'] = '0'<span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #000000"&gt;;                </span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$arr</span>['errmsg'] = 'ok'<span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #000000"&gt;;                </span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$arr</span>['url'] = '本控制器下的<a href="https://m.jb51.cc/tag/dizhi/" target="_blank" >地址</a>/' . 'wx?data=' . <span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$res</span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #000000"&gt;;                </span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$data</span> = <a href="https://m.jb51.cc/tag/Js/" target="_blank" >Js</a>on_encode(<span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$arr</span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #000000"&gt;);            } </span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #0000ff"&gt;else</span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #000000"&gt; {                </span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #0000ff"&gt;if</span> (!<span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #0000ff"&gt;empty</span>(<span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$code</span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #000000"&gt;)) {                    </span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$res</span> = <span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$wechat</span>->get_access_token(<span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$code</span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #000000"&gt;);                    </span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$userinfo</span> = <span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$wechat</span>->get_open<a href="https://m.jb51.cc/tag/ID/" target="_blank" >ID</a>_userinfo(<span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$res</span>['access_token'],<span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$res</span>['open<a href="https://m.jb51.cc/tag/ID/" target="_blank" >ID</a>'<span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #000000"&gt;]);                    </span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$open<a href="https://m.jb51.cc/tag/ID/" target="_blank" >ID</a></span> = <span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$userinfo</span>['open<a href="https://m.jb51.cc/tag/ID/" target="_blank" >ID</a>'<span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #000000"&gt;];                    session</span>::set('open<a href="https://m.jb51.cc/tag/ID/" target="_blank" >ID</a>',<span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$open<a href="https://m.jb51.cc/tag/ID/" target="_blank" >ID</a></span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #000000"&gt;);                    </span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$total_fee</span> = 1<span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #000000"&gt;;                    </span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$out_<a href="https://www.jb51.cc/tag/Trad/" target="_blank" >Trad</a>e_no</span> = '12345678945641231'<span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #000000"&gt;;                    </span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$body</span> = "充值金币支付测试"<span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #000000"&gt;;                    </span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$res</span> = <span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$wechat_pay</span>->pay(<span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$open<a href="https://m.jb51.cc/tag/ID/" target="_blank" >ID</a></span>,<span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$out_<a href="https://www.jb51.cc/tag/Trad/" target="_blank" >Trad</a>e_no</span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #000000"&gt;);                    </span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$arr</span>['errcode'] = '0'<span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #000000"&gt;;                    </span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$arr</span>['errmsg'] = 'ok'<span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #000000"&gt;;                    </span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$arr</span>['url'] = '本控制器下的<a href="https://m.jb51.cc/tag/dizhi/" target="_blank" >地址</a>/' . 'wx?data=' . <span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$res</span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #000000"&gt;;                    </span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$data</span> = <a href="https://m.jb51.cc/tag/Js/" target="_blank" >Js</a>on_encode(<span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$arr</span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #000000"&gt;);                } </span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #0000ff"&gt;else</span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #000000"&gt; {                    </span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$<a href="https://m.jb51.cc/tag/link/" target="_blank" >link</a></span> = '<a href="https://m.jb51.cc/tag/http/" target="_blank" >http</a>://' . <span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$_SERVER</span>['<a href="https://m.jb51.cc/tag/http/" target="_blank" >http</a>_HOST'] . '/#/cz'; <span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #008000"&gt;//</span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #008000"&gt; 前端充值金币<a href="https://www.jb51.cc/tag/yemiandizhi/" target="_blank" >页面地址</a>。</span>                    <a href="https://m.jb51.cc/tag/cookie/" target="_blank" >cookie</a>::set('url',<span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$<a href="https://m.jb51.cc/tag/link/" target="_blank" >link</a></span>,300<span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #000000"&gt;);                    </span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #008000"&gt;//</span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #008000"&gt;$<a href="https://m.jb51.cc/tag/link/" target="_blank" >link</a> <a href="https://m.jb51.cc/tag/zhege/" target="_blank" >这个</a><a href="https://m.jb51.cc/tag/dizhi/" target="_blank" >地址</a>是在微信打开你项目时才会需要的,<a href="https://m.jb51.cc/tag/dizhi/" target="_blank" >地址</a>后面带上<a href="https://www.jb51.cc/tag/huoqu/" target="_blank" >获取</a>的code<a href="https://m.jb51.cc/tag/jinxing/" target="_blank" >进行</a><a href="https://www.jb51.cc/tag/huoqu/" target="_blank" >获取</a>access_token。</span>                    <span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$res</span> = <span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$wechat</span>->code_shouquan(<span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$<a href="https://m.jb51.cc/tag/link/" target="_blank" >link</a></span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #000000"&gt;);                    </span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$arr</span>['errcode'] = '0'<span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #000000"&gt;;                    </span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$arr</span>['errmsg'] = 'ok'<span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #000000"&gt;;                    </span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$arr</span>['url'] = <span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$res</span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #000000"&gt;;                    </span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$data</span> = <a href="https://m.jb51.cc/tag/Js/" target="_blank" >Js</a>on_encode(<span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$arr</span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #000000"&gt;);                }            }        } </span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #0000ff"&gt;else</span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #000000"&gt; {            </span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #008000"&gt;//</span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #008000"&gt;非微信<a href="https://m.jb51.cc/tag/liulanqi/" target="_blank" >浏览器</a></span>            <span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$wechat_pay</span> = <span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #0000ff"&gt;new</span> Weixin_pay(<span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$this</span>->wechat_con<a href="https://www.jb51.cc/tag/fig/" target="_blank" >fig</a>['appsecret'],<span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$this</span>->wechat_con<a href="https://www.jb51.cc/tag/fig/" target="_blank" >fig</a>['mch_<a href="https://m.jb51.cc/tag/ID/" target="_blank" >ID</a>'<span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #000000"&gt;]);            </span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #008000"&gt;//</span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #008000"&gt;h5支付不用传递open<a href="https://m.jb51.cc/tag/ID/" target="_blank" >ID</a> 此处与微信<a href="https://m.jb51.cc/tag/Js/" target="_blank" >Js</a><a href="https://m.jb51.cc/tag/API/" target="_blank" >API</a>支付不同</span>            <span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$open<a href="https://m.jb51.cc/tag/ID/" target="_blank" >ID</a></span> = ""<span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #000000"&gt;;            </span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$total_fee</span> = 1<span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #000000"&gt;;            </span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$out_<a href="https://www.jb51.cc/tag/Trad/" target="_blank" >Trad</a>e_no</span> = '12345678945641231'<span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #000000"&gt;;            </span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$body</span> = "充值金币h5支付测试"<span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #000000"&gt;;            </span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$res</span> = <span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$wechat_pay</span>->payh5(<span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$open<a href="https://m.jb51.cc/tag/ID/" target="_blank" >ID</a></span>,<span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$out_<a href="https://www.jb51.cc/tag/Trad/" target="_blank" >Trad</a>e_no</span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #000000"&gt;);            </span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$arr</span>['errcode'] = '0'<span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #000000"&gt;;            </span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$arr</span>['errmsg'] = 'ok'<span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #000000"&gt;;            </span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$arr</span>['url'] = <span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$res</span>['mweb_url'];<span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #008000"&gt;//</span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #008000"&gt;微信唤起H5支付<a href="https://m.jb51.cc/tag/dizhi/" target="_blank" >地址</a></span>            <span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$data</span> = <a href="https://m.jb51.cc/tag/Js/" target="_blank" >Js</a>on_encode(<span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$arr</span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #000000"&gt;);        }    } </span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #0000ff"&gt;else</span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #000000"&gt; {        </span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$data</span> = '{"errcode":"1001","errmsg":"TOKEN无效"}'<span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #000000"&gt;;    }    </span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #0000ff"&gt;echo</span> <span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$data</span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #000000"&gt;;}</span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #008000"&gt;/*</span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #008000"&gt;在微信打开的时候唤起微信<a href="https://www.jb51.cc/tag/gongzhonghaozhifu/" target="_blank" >公众号支付</a>。</span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #008000"&gt;*/</span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #0000ff"&gt;pub<a href="https://m.jb51.cc/tag/li/" target="_blank" >li</a>c</span> <span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #0000ff"&gt;function</span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #000000"&gt; wx(){    </span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$data</span> = <a href="https://m.jb51.cc/tag/input/" target="_blank" >input</a>('get.data'<span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #000000"&gt;);    </span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$this</span>->assign('data',<span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$data</span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #000000"&gt;);    </span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #0000ff"&gt;return</span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #000000"&gt; v<a href="https://m.jb51.cc/tag/IE/" target="_blank" >IE</a>w();}</span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #008000"&gt;/*</span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #008000"&gt;<a href="https://www.jb51.cc/tag/huoqu/" target="_blank" >获取</a>微信code </span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #008000"&gt;*/</span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #0000ff"&gt;pub<a href="https://m.jb51.cc/tag/li/" target="_blank" >li</a>c</span> <span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #0000ff"&gt;function</span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #000000"&gt; code(){    </span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$code</span> = <a href="https://m.jb51.cc/tag/input/" target="_blank" >input</a>('p<a href="https://www.jb51.cc/tag/ara/" target="_blank" >ara</a>m.code'<span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #000000"&gt;);    </span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$this</span>->redirect(<a href="https://m.jb51.cc/tag/cookie/" target="_blank" >cookie</a>::get('url') . '?code=' . <span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$code</span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #000000"&gt;);}</span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #008000"&gt;/*</span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #008000"&gt;微信回调</span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #008000"&gt;*/</span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #0000ff"&gt;pub<a href="https://m.jb51.cc/tag/li/" target="_blank" >li</a>c</span> <span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #0000ff"&gt;function</span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #000000"&gt; wechat_notify(){    </span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$ccc</span> = <span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #008080"&gt;<a href="https://m.jb51.cc/tag/file/" target="_blank" >file</a>_get_contents</span>('<a href="https://www.jb51.cc/tag/PHP/" target="_blank" >PHP</a>://<a href="https://m.jb51.cc/tag/input/" target="_blank" >input</a>'<span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #000000"&gt;);    </span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$Weixin_pay</span> = <span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #0000ff"&gt;new</span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #000000"&gt; Weixin_pay();    </span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$data</span> = <span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$Weixin_pay</span>->xmlToArray(<span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$ccc</span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #000000"&gt;);    </span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #0000ff"&gt;if</span> (<span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$data</span>['res<a href="https://m.jb51.cc/tag/ul/" target="_blank" >ul</a>t_code'] == 'SUCCESS' &amp;&amp; <span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$data</span>['return_code'] == 'SUCCESS'<span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #000000"&gt;) {        </span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #008000"&gt;//</span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #008000"&gt;<a href="https://www.jb51.cc/tag/huoqu/" target="_blank" >获取</a>订单号</span>        <span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$Ordersn</span> = <span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$data</span>['out_<a href="https://www.jb51.cc/tag/Trad/" target="_blank" >Trad</a>e_no'];<span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #008000"&gt;//</span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #008000"&gt;订单号        // 处理支付成功后的逻辑业务</span>

<span > }
}

</span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #008000"&gt;/*</span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #008000"&gt;微信APP支付 </span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #008000"&gt;*/</span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #0000ff"&gt;pub<a href="https://m.jb51.cc/tag/li/" target="_blank" >li</a>c</span> <span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #0000ff"&gt;function</span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #000000"&gt; app_wechat_pay(){    </span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #0000ff"&gt;if</span> (<a href="https://m.jb51.cc/tag/input/" target="_blank" >input</a>('post.token') ==<span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #000000"&gt; TOKEN) {        </span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$wechat_pay</span> = <span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #0000ff"&gt;new</span> Weixin_pay(<span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$this</span>->wechat_con<a href="https://www.jb51.cc/tag/fig/" target="_blank" >fig</a>['appsecret'],<span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$this</span>->wechat_con<a href="https://www.jb51.cc/tag/fig/" target="_blank" >fig</a>['mch_<a href="https://m.jb51.cc/tag/ID/" target="_blank" >ID</a>'<span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #000000"&gt;]);        </span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #008000"&gt;//</span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #008000"&gt;h5支付不用传递open<a href="https://m.jb51.cc/tag/ID/" target="_blank" >ID</a> 此处与微信<a href="https://m.jb51.cc/tag/Js/" target="_blank" >Js</a><a href="https://m.jb51.cc/tag/API/" target="_blank" >API</a>支付不同</span>        <span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$open<a href="https://m.jb51.cc/tag/ID/" target="_blank" >ID</a></span> = ""<span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #000000"&gt;;        </span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$total_fee</span> = 1<span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #000000"&gt;;        </span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$body</span> = "充值金币APP支付测试"<span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #000000"&gt;;        </span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$order_sn</span> = 123456789;<span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #008000"&gt;//</span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #008000"&gt;订单号</span>        <span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$res</span> = <span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$wechat_pay</span>->app_pay(<span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$body</span>,<span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$order_sn</span>,<span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$total_fee</span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #000000"&gt;);        </span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #0000ff"&gt;if</span> (<span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$res</span>['prepay_<a href="https://m.jb51.cc/tag/ID/" target="_blank" >ID</a>']) {<span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #008000"&gt;//</span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #008000"&gt;判断返回<a href="https://m.jb51.cc/tag/canshu/" target="_blank" >参数</a>中是否有prepay_<a href="https://m.jb51.cc/tag/ID/" target="_blank" >ID</a></span>            <span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$order</span> = <span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$wechat_pay</span>->g<a href="https://www.jb51.cc/tag/eto/" target="_blank" >eto</a>rder(<span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$res</span>['prepay_<a href="https://m.jb51.cc/tag/ID/" target="_blank" >ID</a>']);<span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #008000"&gt;//</span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #008000"&gt;执行二次签名返回<a href="https://m.jb51.cc/tag/canshu/" target="_blank" >参数</a></span>            <span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$arr</span>['errcode'] = '0'<span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #000000"&gt;;            </span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$arr</span>['errmsg'] = 'ok'<span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #000000"&gt;;            </span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$arr</span>['order'] = <span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$order</span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #000000"&gt;;            </span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$data</span> = <a href="https://m.jb51.cc/tag/Js/" target="_blank" >Js</a>on_encode(<span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$arr</span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #000000"&gt;);        } </span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #0000ff"&gt;else</span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #000000"&gt; {            </span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$arr</span>['errcode'] = '1003'<span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #000000"&gt;;            </span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$arr</span>['errmsg'] = <span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$res</span>['err_code_des'<span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #000000"&gt;];            </span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$data</span> = <a href="https://m.jb51.cc/tag/Js/" target="_blank" >Js</a>on_encode(<span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$arr</span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #000000"&gt;);        }    } </span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #0000ff"&gt;else</span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #000000"&gt; {        </span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$data</span> = '{"errcode":"1001","errmsg":"TOKEN无效"}'<span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #000000"&gt;;    }    </span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #0000ff"&gt;echo</span> <span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$data</span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #000000"&gt;;}</span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #008000"&gt;/*</span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #008000"&gt;支付宝开始支付</span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #008000"&gt;*/</span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #0000ff"&gt;pub<a href="https://m.jb51.cc/tag/li/" target="_blank" >li</a>c</span> <span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #0000ff"&gt;function</span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #000000"&gt; a<a href="https://m.jb51.cc/tag/li/" target="_blank" >li</a>pay(){</span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #008000"&gt;//</span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #008000"&gt;发起支付宝支付</span>    <span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #0000ff"&gt;if</span> (<a href="https://m.jb51.cc/tag/input/" target="_blank" >input</a>('post.token') ==<span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #000000"&gt; TOKEN) {        </span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$<a href="https://m.jb51.cc/tag/link/" target="_blank" >link</a></span> = '<a href="https://m.jb51.cc/tag/http/" target="_blank" >http</a>://' . <span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$_SERVER</span>['<a href="https://m.jb51.cc/tag/http/" target="_blank" >http</a>_HOST'] . '/#/cz'<span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #000000"&gt;;        <a href="https://m.jb51.cc/tag/cookie/" target="_blank" >cookie</a></span>::set('url',300<span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #000000"&gt;);        </span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$res</span>['out_<a href="https://www.jb51.cc/tag/Trad/" target="_blank" >Trad</a>e_no'] = 123456798123<span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #000000"&gt;;        </span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$res</span>['subject'] = '充值'<span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #000000"&gt;;        </span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$res</span>['body'] = '测试'<span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #000000"&gt;;        </span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$res</span>['money'] = 0.01<span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #000000"&gt;;        </span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$Pay</span> = <span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #0000ff"&gt;new</span> A<a href="https://m.jb51.cc/tag/li/" target="_blank" >li</a>pay(<span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$this</span>->a<a href="https://m.jb51.cc/tag/li/" target="_blank" >li</a>pay_con<a href="https://www.jb51.cc/tag/fig/" target="_blank" >fig</a>['partner'],<span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$this</span>->a<a href="https://m.jb51.cc/tag/li/" target="_blank" >li</a>pay_con<a href="https://www.jb51.cc/tag/fig/" target="_blank" >fig</a>['md5_key'<span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #000000"&gt;]);        </span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$res<a href="https://m.jb51.cc/tag/ul/" target="_blank" >ul</a>t</span> = <span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$Pay</span>-><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #000000"&gt;a<a href="https://m.jb51.cc/tag/li/" target="_blank" >li</a>pay([            </span>'notify_url' => 'your notify_url','return_url' => 'your return_url','out_<a href="https://www.jb51.cc/tag/Trad/" target="_blank" >Trad</a>e_no' => <span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$res</span>['out_<a href="https://www.jb51.cc/tag/Trad/" target="_blank" >Trad</a>e_no'],'subject' => <span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$res</span>['subject'],'total_fee' => <span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$res</span>['money'],'body' => <span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$res</span>['body'],<span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #000000"&gt;        ]);        </span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$arr</span>['errcode'] = '0'<span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #000000"&gt;;        </span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$arr</span>['errmsg'] = 'ok'<span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #000000"&gt;;        </span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #0000ff"&gt;return</span> <span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$res<a href="https://m.jb51.cc/tag/ul/" target="_blank" >ul</a>t</span>['msg'<span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #000000"&gt;];    } </span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #0000ff"&gt;else</span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #000000"&gt; {        </span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$data</span> = '{"errcode":"1001","errmsg":"TOKEN无效"}'<span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #000000"&gt;;    }    </span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #0000ff"&gt;echo</span> <span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$data</span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #000000"&gt;;}</span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #008000"&gt;/*</span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #008000"&gt;支付宝回调</span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #008000"&gt;*/</span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #0000ff"&gt;pub<a href="https://m.jb51.cc/tag/li/" target="_blank" >li</a>c</span> <span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #0000ff"&gt;function</span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #000000"&gt; a<a href="https://m.jb51.cc/tag/li/" target="_blank" >li</a>pay_notify(){</span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #008000"&gt;//</span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #008000"&gt;异步订单<a href="https://www.jb51.cc/tag/tongzhi/" target="_blank" >通知</a></span>    <span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$wx</span> = sys_con<a href="https://www.jb51.cc/tag/fig/" target="_blank" >fig</a>_get('payment'<span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #000000"&gt;);    </span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$Pay</span> = <span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #0000ff"&gt;new</span> A<a href="https://m.jb51.cc/tag/li/" target="_blank" >li</a>pay(<span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$wx</span>['a<a href="https://m.jb51.cc/tag/li/" target="_blank" >li</a>wappay']['partner'],<span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$wx</span>['a<a href="https://m.jb51.cc/tag/li/" target="_blank" >li</a>wappay']['md5_key'<span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #000000"&gt;]);    </span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$out_<a href="https://www.jb51.cc/tag/Trad/" target="_blank" >Trad</a>e_no</span> = <a href="https://m.jb51.cc/tag/input/" target="_blank" >input</a>('out_<a href="https://www.jb51.cc/tag/Trad/" target="_blank" >Trad</a>e_no'<span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #000000"&gt;);    </span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$<a href="https://www.jb51.cc/tag/Trad/" target="_blank" >Trad</a>e_status</span> = <a href="https://m.jb51.cc/tag/input/" target="_blank" >input</a>('<a href="https://www.jb51.cc/tag/Trad/" target="_blank" >Trad</a>e_status'<span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #000000"&gt;);    </span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #0000ff"&gt;if</span> (<span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$<a href="https://www.jb51.cc/tag/Trad/" target="_blank" >Trad</a>e_status</span> == '<a href="https://www.jb51.cc/tag/Trad/" target="_blank" >Trad</a>E_SUCCESS'<span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #000000"&gt;) {        </span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #008000"&gt;//</span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #008000"&gt; 处理支付成功后的逻辑业务</span>

<span >
} <span >else<span > {
<span >//<span > 处理支付失败后的逻辑业务
<span > }
}
}

模型:Weixin.PHP

namespace app\phone\model;

<span >use<span > think\Db;
<span >use<span > think\ValIDate;
<span >use<span > think\Loader;
<span >use<span > think\Model;

<span >class Weixin <span >extends<span > model
{
<span >protected <span >$appScrect<span >;
<span >protected <span >$appID<span >;

</span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #0000ff"&gt;pub<a href="https://m.jb51.cc/tag/li/" target="_blank" >li</a>c</span> <span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #0000ff"&gt;function</span> __construct(<span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$appScrect</span> = "",<span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$app<a href="https://m.jb51.cc/tag/ID/" target="_blank" >ID</a></span> = ""<span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #000000"&gt;){    </span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$this</span>->appScrect = <span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$appScrect</span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #000000"&gt;;    </span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$this</span>->app<a href="https://m.jb51.cc/tag/ID/" target="_blank" >ID</a> = <span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$app<a href="https://m.jb51.cc/tag/ID/" target="_blank" >ID</a></span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #000000"&gt;;}</span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #008000"&gt;/*</span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #008000"&gt; * 因为本项目需求,前端是Vue<a href="https://www.jb51.cc/tag/houtai/" target="_blank" >后台</a>是TP5两个项目不在<a href="https://www.jb51.cc/tag/yige/" target="_blank" >一个</a><a href="https://m.jb51.cc/tag/fuwuqi/" target="_blank" >服务器</a>所以我的url是return 回控制器通过接口返回给前端 * 如果是正常<a href="https://m.jb51.cc/tag/HTML/" target="_blank" >HTML</a><a href="https://www.jb51.cc/tag/yemian/" target="_blank" >页面</a>可以<a href="https://m.jb51.cc/tag/shiyong/" target="_blank" >使用</a><a href="https://m.jb51.cc/tag/header/" target="_blank" >header</a>("Location: $url"); 以下<a href="https://www.jb51.cc/tag/fangfa/" target="_blank" >方法</a>都是 * </span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #008000"&gt;*/</span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #0000ff"&gt;pub<a href="https://m.jb51.cc/tag/li/" target="_blank" >li</a>c</span> <span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #0000ff"&gt;function</span> code_shouquan(<span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$<a href="https://m.jb51.cc/tag/link/" target="_blank" >link</a></span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #000000"&gt;){    </span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$redirect_uri</span> = <span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #008080"&gt;urlencode</span>('网址/pay/code');<span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #008000"&gt;//</span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #008000"&gt;微信<a href="https://www.jb51.cc/tag/huoqu/" target="_blank" >获取</a><a href="https://m.jb51.cc/tag/wangye/" target="_blank" >网页</a>授权<a href="https://m.jb51.cc/tag/dizhi/" target="_blank" >地址</a>    // 1、引导<a href="https://www.jb51.cc/tag/yonghu/" target="_blank" >用户</a>进入授权<a href="https://www.jb51.cc/tag/yemian/" target="_blank" >页面</a>同意授权,<a href="https://www.jb51.cc/tag/huoqu/" target="_blank" >获取</a>code    // 2、通过code换取<a href="https://m.jb51.cc/tag/wangye/" target="_blank" >网页</a>授权access_token    // 3、如果需要,开发者可以刷新<a href="https://m.jb51.cc/tag/wangye/" target="_blank" >网页</a>授权access_token,避免过期    // 4、通过<a href="https://m.jb51.cc/tag/wangye/" target="_blank" >网页</a>授权access_token和open<a href="https://m.jb51.cc/tag/ID/" target="_blank" >ID</a><a href="https://www.jb51.cc/tag/huoqu/" target="_blank" >获取</a><a href="https://www.jb51.cc/tag/yonghu/" target="_blank" >用户</a>基本信息(<a href="https://www.jb51.cc/tag/zhichi/" target="_blank" >支持</a>Union<a href="https://m.jb51.cc/tag/ID/" target="_blank" >ID</a>机制)</span>    <span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$url</span> = "<a href="https://m.jb51.cc/tag/http/" target="_blank" >http</a>s://open.weixin.qq.com/connect/oauth2/authorize?app<a href="https://m.jb51.cc/tag/ID/" target="_blank" >ID</a>=" . <span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$this</span>->app<a href="https://m.jb51.cc/tag/ID/" target="_blank" >ID</a> . "&amp;redirect_uri=" . <span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$redirect_uri</span> . "&amp;response_type=code&amp;s<a href="https://www.jb51.cc/tag/cop/" target="_blank" >cop</a>e=sns<a href="https://m.jb51.cc/tag/API/" target="_blank" >API</a>_userinfo&amp;state=1234#wechat_redirect"<span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #000000"&gt;;    </span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #0000ff"&gt;return</span> <span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$url</span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #000000"&gt;;}</span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #0000ff"&gt;pub<a href="https://m.jb51.cc/tag/li/" target="_blank" >li</a>c</span> <span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #0000ff"&gt;function</span> get_access_token(<span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$code</span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #000000"&gt;){    </span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #008000"&gt;//</span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #008000"&gt;检测缓存中是否有access_token(2小时),如果存在直接返回,不存在则检测缓存中的refresh_token(30天),// refresh_token如果存在<a href="https://www.jb51.cc/tag/diaoyong/" target="_blank" >调用</a>刷新缓存;如果不存在重新发起授权code授权</span>    <span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$url</span> = "<a href="https://m.jb51.cc/tag/http/" target="_blank" >http</a>s://<a href="https://m.jb51.cc/tag/API/" target="_blank" >API</a>.weixin.qq.com/sns/oauth2/access_token?app<a href="https://m.jb51.cc/tag/ID/" target="_blank" >ID</a>=" . <span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$this</span>->app<a href="https://m.jb51.cc/tag/ID/" target="_blank" >ID</a> . "&amp;secret=" . <span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$this</span>->appScrect . "&amp;code=" . <span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$code</span> . "&amp;grant_type=authorization_code"<span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #000000"&gt;;    </span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$res</span> = <span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$this</span>->sendRequest(<span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$url</span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #000000"&gt;);    </span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #0000ff"&gt;return</span> <span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$res</span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #000000"&gt;;}</span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #0000ff"&gt;pub<a href="https://m.jb51.cc/tag/li/" target="_blank" >li</a>c</span> <span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #0000ff"&gt;function</span> get_refresh_token(<span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$refresh_token</span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #000000"&gt;){    </span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$url</span> = "<a href="https://m.jb51.cc/tag/http/" target="_blank" >http</a>s://<a href="https://m.jb51.cc/tag/API/" target="_blank" >API</a>.weixin.qq.com/sns/oauth2/refresh_token?app<a href="https://m.jb51.cc/tag/ID/" target="_blank" >ID</a>=" . <span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$this</span>->app<a href="https://m.jb51.cc/tag/ID/" target="_blank" >ID</a> . "&amp;grant_type=refresh_token&amp;refresh_token=" . <span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$refresh_token</span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #000000"&gt;;    </span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$res</span> = <span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$this</span>->sendRequest(<span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$url</span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #000000"&gt;);    </span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #0000ff"&gt;return</span> <span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$res</span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #000000"&gt;;}</span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #0000ff"&gt;pub<a href="https://m.jb51.cc/tag/li/" target="_blank" >li</a>c</span> <span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #0000ff"&gt;function</span> get_open<a href="https://m.jb51.cc/tag/ID/" target="_blank" >ID</a>_userinfo(<span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$access_token</span>,<span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$open<a href="https://m.jb51.cc/tag/ID/" target="_blank" >ID</a></span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #000000"&gt;){    </span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$url</span> = "<a href="https://m.jb51.cc/tag/http/" target="_blank" >http</a>s://<a href="https://m.jb51.cc/tag/API/" target="_blank" >API</a>.weixin.qq.com/sns/userinfo?access_token=" . <span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$access_token</span> . "&amp;open<a href="https://m.jb51.cc/tag/ID/" target="_blank" >ID</a>=" . <span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$open<a href="https://m.jb51.cc/tag/ID/" target="_blank" >ID</a></span> . "&amp;lang=zh_CN"<span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #000000"&gt;;    </span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$res</span> = <span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$this</span>->sendRequest(<span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$url</span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #000000"&gt;);    </span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #0000ff"&gt;return</span> <span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$res</span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #000000"&gt;;}</span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #008000"&gt;/*</span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #008000"&gt;

发送请求
<span >*/
<span >public <span >function sendRequest(<span >$url<span >)
{
<span >$ch =<span > curl_init();
curl_setopt(<span >$ch,CURLOPT_URL,<span >$url<span >);
curl_setopt(<span >$ch,CURLOPT_SSL_VERIFYPEER,<span >FALSE<span >);
curl_setopt(<span >$ch,CURLOPT_SSL_VERIFYHOST,CURLOPT_RETURNTRANSFER,1<span >);
<span >$output = curl_exec(<span >$ch<span >);
curl_close(<span >$ch<span >);
<span >return Json_decode(<span >$output,<span >true<span >);
}
}

Weixin.PHP

<span >class Weixin_pay <span >extends<span > model
{
<span >protected
<span >$appScrect
;<span >//
<span >微信公众平台的appscrect

<span >protected <span >$appID;<span >//<span >微信公众平台appID
<span >protected <span >$key;<span >//<span >微信商户平台配置的秘钥
<span >protected <span >$mch_ID;<span >//<span >微信商户号
<span >protected <span >$values = <span >array<span >();

</span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #0000ff"&gt;pub<a href="https://m.jb51.cc/tag/li/" target="_blank" >li</a>c</span> <span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #0000ff"&gt;function</span> __construct(<span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$appScrect</span>="",<span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$app<a href="https://m.jb51.cc/tag/ID/" target="_blank" >ID</a></span>="",<span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$key</span>="",<span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$mch_<a href="https://m.jb51.cc/tag/ID/" target="_blank" >ID</a></span> =''<span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #000000"&gt;){    </span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$this</span>->appScrect=<span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$appScrect</span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #000000"&gt;;    </span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$this</span>->app<a href="https://m.jb51.cc/tag/ID/" target="_blank" >ID</a>=<span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$app<a href="https://m.jb51.cc/tag/ID/" target="_blank" >ID</a></span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #000000"&gt;;    </span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$this</span>-><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #008080"&gt;key</span>=<span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$key</span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #000000"&gt;;    </span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$this</span>->mch_<a href="https://m.jb51.cc/tag/ID/" target="_blank" >ID</a>=<span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$mch_<a href="https://m.jb51.cc/tag/ID/" target="_blank" >ID</a></span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #000000"&gt;;}</span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #0000ff"&gt;pub<a href="https://m.jb51.cc/tag/li/" target="_blank" >li</a>c</span> <span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #0000ff"&gt;function</span> app_pay(<span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$body</span>,<span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$out_<a href="https://www.jb51.cc/tag/Trad/" target="_blank" >Trad</a>e_no</span>,<span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$total_fee</span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #000000"&gt;){    </span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$url</span> = "<a href="https://m.jb51.cc/tag/http/" target="_blank" >http</a>s://<a href="https://m.jb51.cc/tag/API/" target="_blank" >API</a>.mch.weixin.qq.com/pay/unif<a href="https://m.jb51.cc/tag/IE/" target="_blank" >IE</a>dorder"<span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #000000"&gt;;    </span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$notify_url</span> = '';<span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #008000"&gt;//</span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #008000"&gt;可以<a href="https://www.jb51.cc/tag/zaizhe/" target="_blank" >在这</a>填写回调<a href="https://m.jb51.cc/tag/dizhi/" target="_blank" >地址</a>也可以<a href="https://www.jb51.cc/tag/zengjia/" target="_blank" >增加</a><a href="https://www.jb51.cc/tag/yige/" target="_blank" >一个</a><a href="https://m.jb51.cc/tag/canshu/" target="_blank" >参数</a>传过来。也可以直接在构造里面加<a href="https://www.jb51.cc/tag/yige/" target="_blank" >一个</a>notify_<a href="https://www.jb51.cc/tag/URLdizhi/" target="_blank" >URL地址</a></span>    <span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$onoce_str</span> = <span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$this</span>-><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #000000"&gt;createNonce<a href="https://www.jb51.cc/tag/str/" target="_blank" >str()</a>;    </span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$data</span>["app<a href="https://m.jb51.cc/tag/ID/" target="_blank" >ID</a>"] = <span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$this</span>-><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #000000"&gt;app<a href="https://m.jb51.cc/tag/ID/" target="_blank" >ID</a>;    </span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$data</span>["body"] = <span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$body</span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #000000"&gt;;    </span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$data</span>["mch_<a href="https://m.jb51.cc/tag/ID/" target="_blank" >ID</a>"] = <span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$this</span>-><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #000000"&gt;mch_<a href="https://m.jb51.cc/tag/ID/" target="_blank" >ID</a>;    </span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$data</span>["nonce_str"] = <span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$onoce_str</span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #000000"&gt;;    </span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$data</span>["notify_url"] = <span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$notify_url</span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #000000"&gt;;    </span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$data</span>["out_<a href="https://www.jb51.cc/tag/Trad/" target="_blank" >Trad</a>e_no"] = <span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$out_<a href="https://www.jb51.cc/tag/Trad/" target="_blank" >Trad</a>e_no</span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #000000"&gt;;    </span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$data</span>["spbill_create_ip"] = <span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$this</span>-><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #000000"&gt;get_cl<a href="https://m.jb51.cc/tag/IE/" target="_blank" >IE</a>nt_ip();    </span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$data</span>["total_fee"] = <span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$total_fee</span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #000000"&gt;;    </span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$data</span>["<a href="https://www.jb51.cc/tag/Trad/" target="_blank" >Trad</a>e_type"] = "APP"<span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #000000"&gt;;    </span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$sign</span> = <span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$this</span>->getSign(<span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$data</span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #000000"&gt;);    </span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$data</span>["sign"] = <span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$sign</span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #000000"&gt;;    </span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$xml</span> = <span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$this</span>->arrayToXml(<span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$data</span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #000000"&gt;);    </span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$response</span> = <span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$this</span>->postXmlCurl(<span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$xml</span>,<span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$url</span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #000000"&gt;);    </span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #008000"&gt;//</span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #008000"&gt; return $xml;    //将微信返回的结果xml转成数组</span>    <span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$response</span> = <span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$this</span>->xmlToArray(<span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$response</span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #000000"&gt;);    </span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #008000"&gt;//</span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #008000"&gt;返回数据</span>    <span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #0000ff"&gt;return</span> <span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$response</span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #000000"&gt;;}</span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #008000"&gt;//</span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #008000"&gt;执行第二次签名,才能返回给客户端<a href="https://m.jb51.cc/tag/shiyong/" target="_blank" >使用</a></span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #0000ff"&gt;pub<a href="https://m.jb51.cc/tag/li/" target="_blank" >li</a>c</span> <span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #0000ff"&gt;function</span> g<a href="https://www.jb51.cc/tag/eto/" target="_blank" >eto</a>rder(<span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$prepay<a href="https://m.jb51.cc/tag/ID/" target="_blank" >ID</a></span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #000000"&gt;){    </span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$data</span>["app<a href="https://m.jb51.cc/tag/ID/" target="_blank" >ID</a>"] = <span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$this</span>-><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #000000"&gt;app<a href="https://m.jb51.cc/tag/ID/" target="_blank" >ID</a>;    </span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$data</span>["noncestr"] = <span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$this</span>-><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #000000"&gt;createNonce<a href="https://www.jb51.cc/tag/str/" target="_blank" >str()</a>;;    </span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$data</span>["package"] = "Sign=WXPay"<span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #000000"&gt;;    </span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$data</span>["partner<a href="https://m.jb51.cc/tag/ID/" target="_blank" >ID</a>"] = <span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$this</span>-><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #000000"&gt;mch_<a href="https://m.jb51.cc/tag/ID/" target="_blank" >ID</a>;    </span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$data</span>["prepay<a href="https://m.jb51.cc/tag/ID/" target="_blank" >ID</a>"] = <span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$prepay<a href="https://m.jb51.cc/tag/ID/" target="_blank" >ID</a></span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #000000"&gt;;    </span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$data</span>["timestamp"] = <span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #008080"&gt;time</span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #000000"&gt;();    </span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$s</span> = <span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$this</span>->getSign(<span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$data</span>,<span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #0000ff"&gt;false</span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #000000"&gt;);    </span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$data</span>["sign"] = <span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$s</span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #000000"&gt;;    </span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #0000ff"&gt;return</span> <span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$data</span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #000000"&gt;;}</span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #008000"&gt;/*</span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #008000"&gt;<a href="https://www.jb51.cc/tag/gongzhonghaozhifu/" target="_blank" >公众号支付</a> </span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #008000"&gt;*/</span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #0000ff"&gt;pub<a href="https://m.jb51.cc/tag/li/" target="_blank" >li</a>c</span> <span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #0000ff"&gt;function</span> pay(<span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$open<a href="https://m.jb51.cc/tag/ID/" target="_blank" >ID</a></span>,<span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$out_<a href="https://www.jb51.cc/tag/Trad/" target="_blank" >Trad</a>e_no</span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #000000"&gt;){    </span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$url</span> = "<a href="https://m.jb51.cc/tag/http/" target="_blank" >http</a>s://<a href="https://m.jb51.cc/tag/API/" target="_blank" >API</a>.mch.weixin.qq.com/pay/unif<a href="https://m.jb51.cc/tag/IE/" target="_blank" >IE</a>dorder"<span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #000000"&gt;;    </span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$notify_url</span> = ''<span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #000000"&gt;;    </span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$onoce_str</span> = <span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$this</span>-><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #000000"&gt;createNonce<a href="https://www.jb51.cc/tag/str/" target="_blank" >str()</a>;    </span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$data</span>["app<a href="https://m.jb51.cc/tag/ID/" target="_blank" >ID</a>"] = <span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$this</span>-><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #000000"&gt;app<a href="https://m.jb51.cc/tag/ID/" target="_blank" >ID</a>;    </span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$data</span>["body"] = <span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$body</span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #000000"&gt;;    </span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$data</span>["mch_<a href="https://m.jb51.cc/tag/ID/" target="_blank" >ID</a>"] = <span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$this</span>-><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #000000"&gt;mch_<a href="https://m.jb51.cc/tag/ID/" target="_blank" >ID</a>;    </span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$data</span>["nonce_str"] = <span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$onoce_str</span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #000000"&gt;;    </span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$data</span>["notify_url"] = <span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$notify_url</span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #000000"&gt;;    </span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$data</span>["out_<a href="https://www.jb51.cc/tag/Trad/" target="_blank" >Trad</a>e_no"] = <span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$out_<a href="https://www.jb51.cc/tag/Trad/" target="_blank" >Trad</a>e_no</span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #000000"&gt;;    </span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$data</span>["spbill_create_ip"] = <span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$this</span>-><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #000000"&gt;get_cl<a href="https://m.jb51.cc/tag/IE/" target="_blank" >IE</a>nt_ip();    </span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$data</span>["total_fee"] = <span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$total_fee</span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #000000"&gt;;    </span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$data</span>["<a href="https://www.jb51.cc/tag/Trad/" target="_blank" >Trad</a>e_type"] = "<a href="https://m.jb51.cc/tag/Js/" target="_blank" >Js</a><a href="https://m.jb51.cc/tag/API/" target="_blank" >API</a>"<span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #000000"&gt;;    </span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$data</span>["open<a href="https://m.jb51.cc/tag/ID/" target="_blank" >ID</a>"] = <span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$open<a href="https://m.jb51.cc/tag/ID/" target="_blank" >ID</a></span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #000000"&gt;;    </span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$sign</span> = <span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$this</span>->getSign(<span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$data</span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #000000"&gt;);    </span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$data</span>["sign"] = <span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$sign</span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #000000"&gt;;    </span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$xml</span> = <span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$this</span>->arrayToXml(<span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$data</span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #000000"&gt;);    </span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$response</span> = <span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$this</span>->postXmlCurl(<span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$xml</span>,<span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$url</span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #000000"&gt;);    </span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #008000"&gt;//</span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #008000"&gt;将微信返回的结果xml转成数组</span>    <span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$response</span> = <span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$this</span>->xmlToArray(<span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$response</span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #000000"&gt;);    </span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$<a href="https://m.jb51.cc/tag/Js/" target="_blank" >Js</a><a href="https://m.jb51.cc/tag/API/" target="_blank" >API</a></span>=<span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #0000ff"&gt;array</span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #000000"&gt;();    </span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$timeStamp</span> = <span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #008080"&gt;time</span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #000000"&gt;();    </span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$<a href="https://m.jb51.cc/tag/Js/" target="_blank" >Js</a><a href="https://m.jb51.cc/tag/API/" target="_blank" >API</a></span>['app<a href="https://m.jb51.cc/tag/ID/" target="_blank" >ID</a>']=(<span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$response</span>["app<a href="https://m.jb51.cc/tag/ID/" target="_blank" >ID</a>"<span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #000000"&gt;]);        </span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$<a href="https://m.jb51.cc/tag/Js/" target="_blank" >Js</a><a href="https://m.jb51.cc/tag/API/" target="_blank" >API</a></span>['timeStamp']=("<span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$timeStamp</span>"<span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #000000"&gt;);    </span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$<a href="https://m.jb51.cc/tag/Js/" target="_blank" >Js</a><a href="https://m.jb51.cc/tag/API/" target="_blank" >API</a></span>['nonceStr']=(<span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$this</span>-><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #000000"&gt;createNonce<a href="https://www.jb51.cc/tag/str/" target="_blank" >str()</a>);    </span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$<a href="https://m.jb51.cc/tag/Js/" target="_blank" >Js</a><a href="https://m.jb51.cc/tag/API/" target="_blank" >API</a></span>['package']=("prepay_<a href="https://m.jb51.cc/tag/ID/" target="_blank" >ID</a>=" . <span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$response</span>['prepay_<a href="https://m.jb51.cc/tag/ID/" target="_blank" >ID</a>'<span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #000000"&gt;]);    </span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$<a href="https://m.jb51.cc/tag/Js/" target="_blank" >Js</a><a href="https://m.jb51.cc/tag/API/" target="_blank" >API</a></span>['signType']=("MD5"<span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #000000"&gt;);    </span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$<a href="https://m.jb51.cc/tag/Js/" target="_blank" >Js</a><a href="https://m.jb51.cc/tag/API/" target="_blank" >API</a></span>['paySign']=(<span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$this</span>->getSign(<span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$<a href="https://m.jb51.cc/tag/Js/" target="_blank" >Js</a><a href="https://m.jb51.cc/tag/API/" target="_blank" >API</a></span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #000000"&gt;));    </span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$p<a href="https://www.jb51.cc/tag/ara/" target="_blank" >ara</a>meters</span> = <a href="https://m.jb51.cc/tag/Js/" target="_blank" >Js</a>on_encode(<span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$<a href="https://m.jb51.cc/tag/Js/" target="_blank" >Js</a><a href="https://m.jb51.cc/tag/API/" target="_blank" >API</a></span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #000000"&gt;);    </span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #008000"&gt;//</span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #008000"&gt; halt($<a href="https://m.jb51.cc/tag/Js/" target="_blank" >Js</a><a href="https://m.jb51.cc/tag/API/" target="_blank" >API</a>);    //请求数据,统一下单  </span>    <span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #0000ff"&gt;return</span> <span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$p<a href="https://www.jb51.cc/tag/ara/" target="_blank" >ara</a>meters</span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #000000"&gt;; }</span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #0000ff"&gt;pub<a href="https://m.jb51.cc/tag/li/" target="_blank" >li</a>c</span> <span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #0000ff"&gt;function</span> payh5(<span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$open<a href="https://m.jb51.cc/tag/ID/" target="_blank" >ID</a></span>,<span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$out_<a href="https://www.jb51.cc/tag/Trad/" target="_blank" >Trad</a>e_no</span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #000000"&gt;){    </span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$url</span> = "<a href="https://m.jb51.cc/tag/http/" target="_blank" >http</a>s://<a href="https://m.jb51.cc/tag/API/" target="_blank" >API</a>.mch.weixin.qq.com/pay/unif<a href="https://m.jb51.cc/tag/IE/" target="_blank" >IE</a>dorder"<span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #000000"&gt;;    </span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$notify_url</span> = ''<span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #000000"&gt;;    </span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$onoce_str</span> = <span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$this</span>-><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #000000"&gt;createNonce<a href="https://www.jb51.cc/tag/str/" target="_blank" >str()</a>;    </span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$data</span>["app<a href="https://m.jb51.cc/tag/ID/" target="_blank" >ID</a>"] = <span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$this</span>-><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #000000"&gt;app<a href="https://m.jb51.cc/tag/ID/" target="_blank" >ID</a>;    </span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$data</span>["body"] = <span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$body</span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #000000"&gt;;    </span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$data</span>["mch_<a href="https://m.jb51.cc/tag/ID/" target="_blank" >ID</a>"] = <span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$this</span>-><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #000000"&gt;mch_<a href="https://m.jb51.cc/tag/ID/" target="_blank" >ID</a>;    </span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$data</span>["nonce_str"] = <span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$onoce_str</span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #000000"&gt;;    </span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$data</span>["notify_url"] = <span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$notify_url</span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #000000"&gt;;    </span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$data</span>["out_<a href="https://www.jb51.cc/tag/Trad/" target="_blank" >Trad</a>e_no"] = <span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$out_<a href="https://www.jb51.cc/tag/Trad/" target="_blank" >Trad</a>e_no</span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #000000"&gt;;    </span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$data</span>["spbill_create_ip"] = <span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$this</span>-><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #000000"&gt;get_cl<a href="https://m.jb51.cc/tag/IE/" target="_blank" >IE</a>nt_ip();    </span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$data</span>["total_fee"] = <span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$total_fee</span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #000000"&gt;;    </span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$data</span>["<a href="https://www.jb51.cc/tag/Trad/" target="_blank" >Trad</a>e_type"] = "MWEB"<span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #000000"&gt;;    </span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$data</span>["scene_info"] = "{'h5_info': {'type':'Wap','wap_url':  <span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$notify_url</span>,'wap_<a href="https://m.jb51.cc/tag/name/" target="_blank" >name</a>': '测试充值'}}"<span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #000000"&gt;;    </span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$sign</span> = <span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$this</span>->getSign(<span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$data</span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #000000"&gt;);    </span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$data</span>["sign"] = <span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$sign</span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #000000"&gt;;    </span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$xml</span> = <span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$this</span>->arrayToXml(<span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$data</span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #000000"&gt;);    </span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #008000"&gt;//</span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #008000"&gt; return $data;</span>    <span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$response</span> = <span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$this</span>->postXmlCurl(<span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$xml</span>,<span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$url</span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #000000"&gt;);    </span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #008000"&gt;//</span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #008000"&gt;将微信返回的结果xml转成数组</span>    <span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$response</span> = <span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$this</span>->xmlToArray(<span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$response</span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #000000"&gt;);    </span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #008000"&gt;//</span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #008000"&gt;请求数据,统一下单  </span>    <span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #0000ff"&gt;return</span> <span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$response</span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #000000"&gt;; }</span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #0000ff"&gt;pub<a href="https://m.jb51.cc/tag/li/" target="_blank" >li</a>c</span> <span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #0000ff"&gt;static</span> <span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #0000ff"&gt;function</span> getNonceStr(<span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$length</span> = 32<span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #000000"&gt;){    </span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$chars</span> = "abcdefghijklm<a href="https://www.jb51.cc/tag/nop/" target="_blank" >nop</a>qrstuvwxyz0123456789"<span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #000000"&gt;;    </span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$str</span> =""<span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #000000"&gt;;    </span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #0000ff"&gt;for</span> ( <span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$i</span> = 0; <span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$i</span> < <span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$length</span>; <span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$i</span>++<span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #000000"&gt; )  {        </span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$str</span> .= <span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #008080"&gt;substr</span>(<span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$chars</span>,<span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #008080"&gt;mt_rand</span>(0,<span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #008080"&gt;strlen</span>(<span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$chars</span>)-1),1<span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #000000"&gt;);    }    </span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #0000ff"&gt;return</span> <span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$str</span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #000000"&gt;;}</span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #008000"&gt;//</span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #008000"&gt;   /*<a href="https://www.jb51.cc/tag/shengcheng/" target="_blank" >生成</a>签名*/</span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #0000ff"&gt;pub<a href="https://m.jb51.cc/tag/li/" target="_blank" >li</a>c</span> <span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #0000ff"&gt;function</span> getSign(<span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$Obj</span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #000000"&gt;){    </span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #0000ff"&gt;foreach</span> (<span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$Obj</span> <span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #0000ff"&gt;as</span> <span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$k</span> => <span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$v</span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #000000"&gt;){        </span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$P<a href="https://www.jb51.cc/tag/ara/" target="_blank" >ara</a>meters</span>[<span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$k</span>] = <span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$v</span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #000000"&gt;;    }    </span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #008000"&gt;//</span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #008000"&gt;签名步骤一:按字典序<a href="https://m.jb51.cc/tag/paixu/" target="_blank" >排序</a><a href="https://m.jb51.cc/tag/canshu/" target="_blank" >参数</a></span>    <span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #008080"&gt;ksort</span>(<span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$P<a href="https://www.jb51.cc/tag/ara/" target="_blank" >ara</a>meters</span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #000000"&gt;);    </span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$String</span> = <span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$this</span>->formatBiz<a href="https://m.jb51.cc/tag/query/" target="_blank" >query</a>P<a href="https://www.jb51.cc/tag/ara/" target="_blank" >ara</a>Map(<span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$P<a href="https://www.jb51.cc/tag/ara/" target="_blank" >ara</a>meters</span>,<span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #0000ff"&gt;false</span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #000000"&gt;);    </span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #008000"&gt;//</span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #008000"&gt;echo '【string1】'.$String.'</br>';    //签名步骤二:在string后加入KEY</span>    <span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$String</span> = <span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$String</span>."&amp;key=".<span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$this</span>-><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #008080"&gt;key</span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #000000"&gt;;    </span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #008000"&gt;//</span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #008000"&gt;echo "【string2】".$String."</br>";    //签名步骤三:MD5加密</span>    <span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$String</span> = <span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #008080"&gt;md5</span>(<span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$String</span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #000000"&gt;);    </span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #008000"&gt;//</span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #008000"&gt;echo "【string3】 ".$String."</br>";    //签名步骤四:所有字符转为大写</span>    <span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$res<a href="https://m.jb51.cc/tag/ul/" target="_blank" >ul</a>t_</span> = <span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #008080"&gt;str<a href="https://www.jb51.cc/tag/toupper/" target="_blank" >toupper</a></span>(<span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$String</span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #000000"&gt;);    </span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #008000"&gt;//</span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #008000"&gt;echo "【res<a href="https://m.jb51.cc/tag/ul/" target="_blank" >ul</a>t】 ".$res<a href="https://m.jb51.cc/tag/ul/" target="_blank" >ul</a>t_."</br>";</span>    <span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #0000ff"&gt;return</span> <span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$res<a href="https://m.jb51.cc/tag/ul/" target="_blank" >ul</a>t_</span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #000000"&gt;;}</span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #008000"&gt;/*</span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #008000"&gt;**  作用:产生<a href="https://www.jb51.cc/tag/suiji/" target="_blank" >随机</a>字符串,不长于32位</span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #008000"&gt;*/</span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #0000ff"&gt;pub<a href="https://m.jb51.cc/tag/li/" target="_blank" >li</a>c</span> <span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #0000ff"&gt;function</span> createNoncestr( <span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$length</span> = 32<span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #000000"&gt; ){    </span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$chars</span> = "abcdefghijklm<a href="https://www.jb51.cc/tag/nop/" target="_blank" >nop</a>qrstuvwxyz0123456789"<span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #000000"&gt;;     </span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$str</span> =""<span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #000000"&gt;;    </span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #0000ff"&gt;for</span> ( <span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$i</span> = 0; <span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$i</span> < <span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$length</span>; <span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$i</span>++<span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #000000"&gt; )  {         </span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$str</span>.= <span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #008080"&gt;substr</span>(<span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$chars</span>,1<span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #000000"&gt;);     }     </span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #0000ff"&gt;return</span> <span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$str</span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #000000"&gt;;}</span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #008000"&gt;//</span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #008000"&gt;数组转xml</span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #0000ff"&gt;pub<a href="https://m.jb51.cc/tag/li/" target="_blank" >li</a>c</span> <span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #0000ff"&gt;function</span> arrayToXml(<span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$arr</span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #000000"&gt;){    </span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$xml</span> = "<xml>"<span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #000000"&gt;;    </span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #0000ff"&gt;foreach</span> (<span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$arr</span> <span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #0000ff"&gt;as</span> <span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$key</span>=><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$val</span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #000000"&gt;){        </span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #0000ff"&gt;if</span> (<span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #008080"&gt;is_numeric</span>(<span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$val</span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #000000"&gt;)){            </span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$xml</span>.="<".<span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$key</span>."&gt;".<span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$val</span>."</".<span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$key</span>."&gt;"<span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #000000"&gt;;        }</span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #0000ff"&gt;else</span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #000000"&gt;{            </span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$xml</span>.="<".<span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$key</span>."&gt;<![<a href="https://m.jb51.cc/tag/cda/" target="_blank" >cda</a>TA[".<span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$val</span>."]]></".<span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$key</span>."&gt;"<span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #000000"&gt;;         }    }    </span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$xml</span>.="</xml>"<span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #000000"&gt;;    </span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #0000ff"&gt;return</span> <span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$xml</span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #000000"&gt;;}</span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #008000"&gt;/*</span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #008000"&gt;**  作用:将xml转为array</span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #008000"&gt;*/</span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #0000ff"&gt;pub<a href="https://m.jb51.cc/tag/li/" target="_blank" >li</a>c</span> <span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #0000ff"&gt;function</span> xmlToArray(<span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$xml</span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #000000"&gt;){      </span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #008000"&gt;//</span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #008000"&gt;将XML转为array       </span>    <span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$array_data</span> = <a href="https://m.jb51.cc/tag/Js/" target="_blank" >Js</a>on_decode(<a href="https://m.jb51.cc/tag/Js/" target="_blank" >Js</a>on_encode(<span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #008080"&gt;simplexml_load_string</span>(<span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$xml</span>,'SimpleXMLElement',<a href="https://m.jb51.cc/tag/li/" target="_blank" >li</a>BXML_NO<a href="https://m.jb51.cc/tag/cda/" target="_blank" >cda</a>TA)),<span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #0000ff"&gt;true</span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #000000"&gt;);    </span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #0000ff"&gt;return</span> <span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$array_data</span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #000000"&gt;;}</span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #008000"&gt;/*</span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #008000"&gt;**  作用:以post方式提交xml到对应的接口url</span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #008000"&gt;*/</span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #0000ff"&gt;pub<a href="https://m.jb51.cc/tag/li/" target="_blank" >li</a>c</span> <span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #0000ff"&gt;function</span> postXmlCurl(<span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$xml</span>,<span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$url</span>,<span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$second</span>=30<span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #000000"&gt;){      </span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #008000"&gt;//</span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #008000"&gt;初始化curl       </span>    <span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$ch</span> =<span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #000000"&gt; curl_init();    </span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #008000"&gt;//</span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #008000"&gt;<a href="https://m.jb51.cc/tag/shezhi/" target="_blank" >设置</a>超时</span>    curl_s<a href="https://www.jb51.cc/tag/eto/" target="_blank" >eto</a>pt(<span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$ch</span>,CURLOPT_TIMEOUT,<span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$second</span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #000000"&gt;);    </span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #008000"&gt;//</span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #008000"&gt;<a href="https://m.jb51.cc/tag/zheli/" target="_blank" >这里</a><a href="https://m.jb51.cc/tag/shezhi/" target="_blank" >设置</a>代理,如果有的话    //curl_s<a href="https://www.jb51.cc/tag/eto/" target="_blank" >eto</a>pt($ch,CURLOPT_PROXY,'8.8.8.8');    //curl_s<a href="https://www.jb51.cc/tag/eto/" target="_blank" >eto</a>pt($ch,CURLOPT_PROXYPORT,8080);</span>    curl_s<a href="https://www.jb51.cc/tag/eto/" target="_blank" >eto</a>pt(<span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$ch</span>,<span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #0000ff"&gt;FALSE</span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #000000"&gt;);    </span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #008000"&gt;//</span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #008000"&gt;<a href="https://m.jb51.cc/tag/shezhi/" target="_blank" >设置</a><a href="https://m.jb51.cc/tag/header/" target="_blank" >header</a></span>    curl_s<a href="https://www.jb51.cc/tag/eto/" target="_blank" >eto</a>pt(<span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$ch</span>,CURLOPT_<a href="https://m.jb51.cc/tag/header/" target="_blank" >header</a>,<span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #0000ff"&gt;FALSE</span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #000000"&gt;);    </span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #008000"&gt;//</span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #008000"&gt;要求结果为字符串且<a href="https://www.jb51.cc/tag/shuchu/" target="_blank" >输出</a>到屏幕上</span>    curl_s<a href="https://www.jb51.cc/tag/eto/" target="_blank" >eto</a>pt(<span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$ch</span>,<span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #0000ff"&gt;TRUE</span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #000000"&gt;);    </span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #008000"&gt;//</span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #008000"&gt;post提交方式</span>    curl_s<a href="https://www.jb51.cc/tag/eto/" target="_blank" >eto</a>pt(<span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$ch</span>,CURLOPT_POST,<span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #0000ff"&gt;TRUE</span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #000000"&gt;);    curl_s<a href="https://www.jb51.cc/tag/eto/" target="_blank" >eto</a>pt(</span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$ch</span>,CURLOPT_POSTF<a href="https://m.jb51.cc/tag/IE/" target="_blank" >IE</a>LDS,<span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$xml</span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #000000"&gt;);    </span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #008000"&gt;//</span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #008000"&gt;运行curl</span>    <span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$data</span> = curl_exec(<span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$ch</span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #000000"&gt;);    </span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #008000"&gt;//</span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #008000"&gt;返回结果</span>    <span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #0000ff"&gt;if</span>(<span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$data</span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #000000"&gt;){        curl_close(</span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$ch</span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #000000"&gt;);        </span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #0000ff"&gt;return</span> <span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$data</span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #000000"&gt;;    }</span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #0000ff"&gt;else</span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #000000"&gt;{        </span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$error</span> = curl_errno(<span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$ch</span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #000000"&gt;);        </span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #0000ff"&gt;echo</span> "curl出错,<a href="https://www.jb51.cc/tag/cuowu/" target="_blank" >错误</a>码:<span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$error</span>"."<br>"<span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #000000"&gt;;        curl_close(</span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$ch</span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #000000"&gt;);        </span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #0000ff"&gt;return</span> <span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #0000ff"&gt;false</span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #000000"&gt;;    }}</span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #008000"&gt;/*</span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #008000"&gt;<a href="https://www.jb51.cc/tag/huoqu/" target="_blank" >获取</a>当前<a href="https://m.jb51.cc/tag/fuwuqi/" target="_blank" >服务器</a>的IP</span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #008000"&gt;*/</span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #0000ff"&gt;pub<a href="https://m.jb51.cc/tag/li/" target="_blank" >li</a>c</span> <span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #0000ff"&gt;function</span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #000000"&gt; get_cl<a href="https://m.jb51.cc/tag/IE/" target="_blank" >IE</a>nt_ip(){    </span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #0000ff"&gt;if</span>(<span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #008080"&gt;getenv</span>('<a href="https://m.jb51.cc/tag/http/" target="_blank" >http</a>_CL<a href="https://m.jb51.cc/tag/IE/" target="_blank" >IE</a>NT_IP') &amp;&amp; <span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #008080"&gt;strcasecmp</span>(<span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #008080"&gt;getenv</span>('<a href="https://m.jb51.cc/tag/http/" target="_blank" >http</a>_CL<a href="https://m.jb51.cc/tag/IE/" target="_blank" >IE</a>NT_IP'),'unk<a href="https://www.jb51.cc/tag/Now/" target="_blank" >Now</a>n'<span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #000000"&gt;)) {        </span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$ip</span> = <span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #008080"&gt;getenv</span>('<a href="https://m.jb51.cc/tag/http/" target="_blank" >http</a>_CL<a href="https://m.jb51.cc/tag/IE/" target="_blank" >IE</a>NT_IP'<span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #000000"&gt;);    } </span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #0000ff"&gt;elseif</span>(<span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #008080"&gt;getenv</span>('<a href="https://m.jb51.cc/tag/http/" target="_blank" >http</a>_X_FORWARDED_FOR') &amp;&amp; <span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #008080"&gt;strcasecmp</span>(<span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #008080"&gt;getenv</span>('<a href="https://m.jb51.cc/tag/http/" target="_blank" >http</a>_X_FORWARDED_FOR'),'unk<a href="https://www.jb51.cc/tag/Now/" target="_blank" >Now</a>n'<span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #000000"&gt;)) {        </span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$ip</span> = <span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #008080"&gt;getenv</span>('<a href="https://m.jb51.cc/tag/http/" target="_blank" >http</a>_X_FORWARDED_FOR'<span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #000000"&gt;);    } </span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #0000ff"&gt;elseif</span>(<span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #008080"&gt;getenv</span>('REMOTE_ADDR') &amp;&amp; <span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #008080"&gt;strcasecmp</span>(<span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #008080"&gt;getenv</span>('REMOTE_ADDR'),'unk<a href="https://www.jb51.cc/tag/Now/" target="_blank" >Now</a>n'<span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #000000"&gt;)) {        </span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$ip</span> = <span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #008080"&gt;getenv</span>('REMOTE_ADDR'<span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #000000"&gt;);    } </span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #0000ff"&gt;elseif</span>(<span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #0000ff"&gt;isset</span>(<span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$_SERVER</span>['REMOTE_ADDR']) &amp;&amp; <span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$_SERVER</span>['REMOTE_ADDR'] &amp;&amp; <span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #008080"&gt;strcasecmp</span>(<span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$_SERVER</span>['REMOTE_ADDR'],'unk<a href="https://www.jb51.cc/tag/Now/" target="_blank" >Now</a>n'<span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #000000"&gt;)) {        </span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$ip</span> = <span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$_SERVER</span>['REMOTE_ADDR'<span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #000000"&gt;];    }    </span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #0000ff"&gt;return</span> <span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #008080"&gt;preg_match</span> ( '/[\d\.]{7,15}/',<span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$ip</span>,<span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$matches</span> ) ? <span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$matches</span> [0] : ''<span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #000000"&gt;;}</span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #008000"&gt;/*</span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #008000"&gt;**  作用:<a href="https://m.jb51.cc/tag/geshihua/" target="_blank" >格式化</a><a href="https://m.jb51.cc/tag/canshu/" target="_blank" >参数</a>,签名<a href="https://m.jb51.cc/tag/guocheng/" target="_blank" >过程</a>需要<a href="https://m.jb51.cc/tag/shiyong/" target="_blank" >使用</a></span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #008000"&gt;*/</span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #0000ff"&gt;pub<a href="https://m.jb51.cc/tag/li/" target="_blank" >li</a>c</span> <span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #0000ff"&gt;function</span> formatBiz<a href="https://m.jb51.cc/tag/query/" target="_blank" >query</a>P<a href="https://www.jb51.cc/tag/ara/" target="_blank" >ara</a>Map(<span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$p<a href="https://www.jb51.cc/tag/ara/" target="_blank" >ara</a>Map</span>,<span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$urlencode</span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #000000"&gt;){    </span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$buff</span> = ""<span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #000000"&gt;;    </span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #008080"&gt;ksort</span>(<span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$p<a href="https://www.jb51.cc/tag/ara/" target="_blank" >ara</a>Map</span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #000000"&gt;);    </span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #0000ff"&gt;foreach</span> (<span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$p<a href="https://www.jb51.cc/tag/ara/" target="_blank" >ara</a>Map</span> <span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #0000ff"&gt;as</span> <span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$k</span> => <span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$v</span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #000000"&gt;){        </span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #0000ff"&gt;if</span>(<span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$urlencode</span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #000000"&gt;){            </span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$v</span> = <span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #008080"&gt;urlencode</span>(<span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$v</span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #000000"&gt;);        }        </span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$buff</span> .= <span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$k</span> . "=" . <span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$v</span> . "&amp;"<span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #000000"&gt;;    }    </span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$reqPar</span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #000000"&gt;;    </span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #0000ff"&gt;if</span> (<span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #008080"&gt;strlen</span>(<span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$buff</span>) > 0<span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #000000"&gt;){        </span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$reqPar</span> = <span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #008080"&gt;substr</span>(<span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$buff</span>,<span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #008080"&gt;strlen</span>(<span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$buff</span>)-1<span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #000000"&gt;);    }    </span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #0000ff"&gt;return</span> <span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$reqPar</span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #000000"&gt;;}    </span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #0000ff"&gt;pub<a href="https://m.jb51.cc/tag/li/" target="_blank" >li</a>c</span> <span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #0000ff"&gt;function</span> MakeSign(<span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$unif<a href="https://m.jb51.cc/tag/IE/" target="_blank" >IE</a>dorder</span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #000000"&gt;){    </span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$this</span>->values=<span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$unif<a href="https://m.jb51.cc/tag/IE/" target="_blank" >IE</a>dorder</span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #000000"&gt;;    </span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #008000"&gt;//</span><span &gt;签名步骤一:按字典序排序参数    // ksort($this->values);</span>    <span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$string</span> = <span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$this</span>-><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #000000"&gt;ToUrlP<a href="https://www.jb51.cc/tag/ara/" target="_blank" >ara</a>ms();    </span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #008000"&gt;//</span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #008000"&gt;halt($string);    //签名步骤二:在string后加入KEY</span>    <span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$string</span> = <span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$string</span> . "&amp;key=".<span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$this</span>-><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #008080"&gt;key</span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #000000"&gt;;    </span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #008000"&gt;//</span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #008000"&gt;签名步骤三:MD5加密</span>    <span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$string</span> = <span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #008080"&gt;md5</span>(<span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$string</span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #000000"&gt;);    </span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #008000"&gt;//</span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #008000"&gt;签名步骤四:所有字符转为大写</span>    <span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$res<a href="https://m.jb51.cc/tag/ul/" target="_blank" >ul</a>t</span> = <span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #008080"&gt;str<a href="https://www.jb51.cc/tag/toupper/" target="_blank" >toupper</a></span>(<span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$string</span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #000000"&gt;);    </span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #0000ff"&gt;return</span> <span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$res<a href="https://m.jb51.cc/tag/ul/" target="_blank" >ul</a>t</span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #000000"&gt;;}</span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #0000ff"&gt;pub<a href="https://m.jb51.cc/tag/li/" target="_blank" >li</a>c</span> <span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #0000ff"&gt;function</span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #000000"&gt; ToUrlP<a href="https://www.jb51.cc/tag/ara/" target="_blank" >ara</a>ms(){    </span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$buff</span> = ""<span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #000000"&gt;;    </span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #0000ff"&gt;foreach</span> (<span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$this</span>->values <span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #0000ff"&gt;as</span> <span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$k</span> => <span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$v</span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #000000"&gt;)    {        </span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #0000ff"&gt;if</span>(<span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$k</span> != "sign" &amp;&amp; <span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$v</span> != "" &amp;&amp; !<span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #008080"&gt;is_array</span>(<span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$v</span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #000000"&gt;)){            </span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$buff</span> .= <span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$k</span> . "=" . <span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$v</span> . "&amp;"<span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #000000"&gt;;        }    }    </span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$buff</span> = <span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #008080"&gt;trim</span>(<span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$buff</span>,"&amp;"<span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #000000"&gt;);    </span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #0000ff"&gt;return</span> <span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$buff</span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #000000"&gt;;}      </span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #0000ff"&gt;function</span> array2xml(<span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$array</span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #000000"&gt;){    </span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$xml</span>='<xml>'<span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #000000"&gt;;    </span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #0000ff"&gt;foreach</span>(<span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$array</span> <span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #0000ff"&gt;as</span> <span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$key</span>=><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$val</span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #000000"&gt;){        </span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #0000ff"&gt;if</span>(<span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #008080"&gt;is_numeric</span>(<span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$key</span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #000000"&gt;)){            </span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$key</span>="item <a href="https://m.jb51.cc/tag/ID/" target="_blank" >ID</a>=\"<span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$key</span>\""<span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #000000"&gt;;        }</span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #0000ff"&gt;else</span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #000000"&gt;{            </span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #008000"&gt;//</span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #008000"&gt;去掉空格,只取空格之前<a href="https://www.jb51.cc/tag/wenzi/" target="_blank" >文字</a>为key</span>            <span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #0000ff"&gt;<a href="https://m.jb51.cc/tag/List/" target="_blank" >List</a></span>(<span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$key</span>,)=<span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #008080"&gt;explode</span>(' ',<span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$key</span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #000000"&gt;);        }         </span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$xml</span>.="<<span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$key</span>>"<span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #000000"&gt;;        </span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$xml</span>.=<span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #008080"&gt;is_array</span>(<span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$val</span>)?<span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$this</span>->_array2xml(<span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$val</span>):<span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$val</span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #000000"&gt;;        </span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #008000"&gt;//</span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #008000"&gt;去掉空格,只取空格之前<a href="https://www.jb51.cc/tag/wenzi/" target="_blank" >文字</a>为key</span>        <span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #0000ff"&gt;<a href="https://m.jb51.cc/tag/List/" target="_blank" >List</a></span>(<span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$key</span>,<span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$key</span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #000000"&gt;);        </span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$xml</span>.="</<span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$key</span>>"<span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #000000"&gt;;    }        </span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$xml</span>.="</xml>"<span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #000000"&gt;;    </span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #0000ff"&gt;return</span> <span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$xml</span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #000000"&gt;;}   </span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #0000ff"&gt;function</span> xml2array(<span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$xml</span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #000000"&gt;){        </span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #008000"&gt;//</span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #008000"&gt;<a href="https://www.jb51.cc/tag/jinzhi/" target="_blank" >禁止</a>引用外部xml实体</span>    <a href="https://m.jb51.cc/tag/li/" target="_blank" >li</a>bxml_<a href="https://www.jb51.cc/tag/dis/" target="_blank" >dis</a>able_entity_loader(<span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #0000ff"&gt;true</span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #000000"&gt;);    </span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$values</span> = <a href="https://m.jb51.cc/tag/Js/" target="_blank" >Js</a>on_decode(<a href="https://m.jb51.cc/tag/Js/" target="_blank" >Js</a>on_encode(<span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #008080"&gt;simplexml_load_string</span>(<span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$xml</span>,<span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #0000ff"&gt;true</span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #000000"&gt;);      </span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #0000ff"&gt;return</span> <span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$values</span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #000000"&gt;;}</span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #0000ff"&gt;pub<a href="https://m.jb51.cc/tag/li/" target="_blank" >li</a>c</span>  <span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #0000ff"&gt;function</span> request_post(<span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$url</span> = '',<span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$p<a href="https://www.jb51.cc/tag/ara/" target="_blank" >ara</a>m</span> = ''<span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #000000"&gt;){    </span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #0000ff"&gt;if</span> (<span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #0000ff"&gt;empty</span>(<span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$url</span>) || <span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #0000ff"&gt;empty</span>(<span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$p<a href="https://www.jb51.cc/tag/ara/" target="_blank" >ara</a>m</span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #000000"&gt;)) {        </span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #0000ff"&gt;return</span> <span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #0000ff"&gt;false</span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #000000"&gt;;    }    </span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$postUrl</span> = <span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$url</span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #000000"&gt;;    </span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$curlPost</span> = <span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$p<a href="https://www.jb51.cc/tag/ara/" target="_blank" >ara</a>m</span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #000000"&gt;;    </span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$ch</span> = curl_init(); <span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #008000"&gt;//</span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #008000"&gt;初始化curl</span>    curl_s<a href="https://www.jb51.cc/tag/eto/" target="_blank" >eto</a>pt(<span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$ch</span>,<span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$postUrl</span>); <span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #008000"&gt;//</span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #008000"&gt;抓取指定<a href="https://m.jb51.cc/tag/wangye/" target="_blank" >网页</a></span>    curl_s<a href="https://www.jb51.cc/tag/eto/" target="_blank" >eto</a>pt(<span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$ch</span>,0); <span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #008000"&gt;//</span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #008000"&gt;<a href="https://m.jb51.cc/tag/shezhi/" target="_blank" >设置</a><a href="https://m.jb51.cc/tag/header/" target="_blank" >header</a></span>    curl_s<a href="https://www.jb51.cc/tag/eto/" target="_blank" >eto</a>pt(<span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$ch</span>,1); <span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #008000"&gt;//</span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #008000"&gt;要求结果为字符串且<a href="https://www.jb51.cc/tag/shuchu/" target="_blank" >输出</a>到屏幕上</span>    curl_s<a href="https://www.jb51.cc/tag/eto/" target="_blank" >eto</a>pt(<span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$ch</span>,1); <span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #008000"&gt;//</span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #008000"&gt;post提交方式</span>    curl_s<a href="https://www.jb51.cc/tag/eto/" target="_blank" >eto</a>pt(<span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$ch</span>,<span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$curlPost</span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #000000"&gt;);    </span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$data</span> = curl_exec(<span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$ch</span>); <span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #008000"&gt;//</span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #008000"&gt;运行curl</span>    curl_close(<span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$ch</span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #000000"&gt;);    </span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #0000ff"&gt;return</span> <span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$data</span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #000000"&gt;;}</span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #0000ff"&gt;function</span> curl_post_ssl(<span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$url</span>,<span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$vars</span>,<span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$second</span>=30,<span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$a<a href="https://m.jb51.cc/tag/header/" target="_blank" >header</a></span>=<span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #0000ff"&gt;array</span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #000000"&gt;()){    </span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$ch</span> =<span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #000000"&gt; curl_init();    </span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #008000"&gt;//</span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #008000"&gt;curl_s<a href="https://www.jb51.cc/tag/eto/" target="_blank" >eto</a>pt($ch,CURLOPT_VERBOSE,'1');</span>    curl_s<a href="https://www.jb51.cc/tag/eto/" target="_blank" >eto</a>pt(<span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$ch</span>,<span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$second</span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #000000"&gt;);    curl_s<a href="https://www.jb51.cc/tag/eto/" target="_blank" >eto</a>pt(</span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$ch</span>,1<span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #000000"&gt;);    curl_s<a href="https://www.jb51.cc/tag/eto/" target="_blank" >eto</a>pt(</span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$ch</span>,<span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #0000ff"&gt;false</span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #000000"&gt;);    curl_s<a href="https://www.jb51.cc/tag/eto/" target="_blank" >eto</a>pt(</span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$ch</span>,CURLOPT_SSLCERTTYPE,'PEM'<span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #000000"&gt;);    curl_s<a href="https://www.jb51.cc/tag/eto/" target="_blank" >eto</a>pt(</span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$ch</span>,CURLOPT_SSLCERT,'/data/cert/<a href="https://www.jb51.cc/tag/PHP/" target="_blank" >PHP</a>.pem'<span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #000000"&gt;);    curl_s<a href="https://www.jb51.cc/tag/eto/" target="_blank" >eto</a>pt(</span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$ch</span>,CURLOPT_SSLCERTPASSWD,'1234'<span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #000000"&gt;);    curl_s<a href="https://www.jb51.cc/tag/eto/" target="_blank" >eto</a>pt(</span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$ch</span>,CURLOPT_SSLKEYTYPE,CURLOPT_SSLKEY,'/data/cert/<a href="https://www.jb51.cc/tag/PHP/" target="_blank" >PHP</a>_private.pem'<span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #000000"&gt;);    </span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #0000ff"&gt;if</span>( <span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #008080"&gt;count</span>(<span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$a<a href="https://m.jb51.cc/tag/header/" target="_blank" >header</a></span>) >= 1<span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #000000"&gt; ){            curl_s<a href="https://www.jb51.cc/tag/eto/" target="_blank" >eto</a>pt(</span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$ch</span>,CURLOPT_<a href="https://m.jb51.cc/tag/http/" target="_blank" >http</a><a href="https://m.jb51.cc/tag/header/" target="_blank" >header</a>,<span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$a<a href="https://m.jb51.cc/tag/header/" target="_blank" >header</a></span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #000000"&gt;);    }    curl_s<a href="https://www.jb51.cc/tag/eto/" target="_blank" >eto</a>pt(</span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$ch</span>,<span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$vars</span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #000000"&gt;);    </span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$data</span> = curl_exec(<span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$ch</span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #000000"&gt;);    curl_close(</span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$ch</span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #000000"&gt;);    </span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #0000ff"&gt;if</span>(<span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$data</span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #000000"&gt;){        </span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #0000ff"&gt;return</span> <span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$data</span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #000000"&gt;;    }</span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #0000ff"&gt;else</span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #000000"&gt;{        </span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #0000ff"&gt;return</span> <span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #0000ff"&gt;false</span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #000000"&gt;;    }}

}

Alipay.PHP

<span >use<span > think\ValIDate;
<span >use think\<span >Log<span >;
<span >use<span > think\Model;
<span >use<span > lib\<span >Alipaysubmit;

<span >class Alipay <span >extends<span > Model
{
<span >protected <span >$partner<span >;
<span >protected <span >$md5_key<span >;

</span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #0000ff"&gt;pub<a href="https://m.jb51.cc/tag/li/" target="_blank" >li</a>c</span> <span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #0000ff"&gt;function</span> __construct(<span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$partner</span> = "",<span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$md5_key</span> = ""<span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #000000"&gt;){    </span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$this</span>->partner = <span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$partner</span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #000000"&gt;;    </span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$this</span>->md5_key = <span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$md5_key</span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #000000"&gt;;}</span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #0000ff"&gt;pub<a href="https://m.jb51.cc/tag/li/" target="_blank" >li</a>c</span> <span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #0000ff"&gt;static</span> <span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$a<a href="https://m.jb51.cc/tag/li/" target="_blank" >li</a>pay_con<a href="https://www.jb51.cc/tag/fig/" target="_blank" >fig</a></span> =<span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #000000"&gt; [    </span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #008000"&gt;//</span><span &gt; 'partner'         => '',//支付宝partner,2088开头数字    // 'seller_<a href="https://m.jb51.cc/tag/ID/" target="_blank" >ID</a>'         => '',//支付宝partner,2088开头数字    // 'key'             => '',//支付宝密钥</span>    'sign_type' => 'MD5','<a href="https://m.jb51.cc/tag/input/" target="_blank" >input</a>_charset' => 'utf-8','cacert' => '','transport' => '<a href="https://m.jb51.cc/tag/http/" target="_blank" >http</a>','payment_type' => '1','service' => '',<span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #008000"&gt;//</span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #008000"&gt;<a href="https://m.jb51.cc/tag/http/" target="_blank" >http</a>s://docs.open.a<a href="https://m.jb51.cc/tag/li/" target="_blank" >li</a>pay.com/<a href="https://m.jb51.cc/tag/API/" target="_blank" >API</a>_1  看你需要哪个<a href="https://m.jb51.cc/tag/API/" target="_blank" >API</a>接口</span>    'anti_phishing_key' => '','exter_invoke_ip' => '','app_pay' => 'Y',<span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #000000"&gt;];</span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #0000ff"&gt;pub<a href="https://m.jb51.cc/tag/li/" target="_blank" >li</a>c</span> <span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #0000ff"&gt;function</span> a<a href="https://m.jb51.cc/tag/li/" target="_blank" >li</a>pay(<span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$data</span> =<span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #000000"&gt; []){</span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #008000"&gt;//</span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #008000"&gt;发起支付宝支付</span>    <span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$val<a href="https://m.jb51.cc/tag/ID/" target="_blank" >ID</a>ate</span> = <span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #0000ff"&gt;new</span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #000000"&gt; Val<a href="https://m.jb51.cc/tag/ID/" target="_blank" >ID</a>ate([        [</span>'out_<a href="https://www.jb51.cc/tag/Trad/" target="_blank" >Trad</a>e_no','require|<a href="https://m.jb51.cc/tag/Alpha/" target="_blank" >Alpha</a>Num','订单编号输入<a href="https://www.jb51.cc/tag/cuowu/" target="_blank" >错误</a>1|订单编号输入<a href="https://www.jb51.cc/tag/cuowu/" target="_blank" >错误</a>2'],<span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #000000"&gt;        [</span>'total_fee','require|number|gt:0','金额输入<a href="https://www.jb51.cc/tag/cuowu/" target="_blank" >错误</a>|金额输入<a href="https://www.jb51.cc/tag/cuowu/" target="_blank" >错误</a>|金额输入<a href="https://www.jb51.cc/tag/cuowu/" target="_blank" >错误</a>'],<span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #000000"&gt;        [</span>'subject','require','请输入<a href="https://www.jb51.cc/tag/biaoti/" target="_blank" >标题</a>'],<span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #000000"&gt;        [</span>'body','请输入描述'],<span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #000000"&gt;        [</span>'notify_url','异步<a href="https://www.jb51.cc/tag/tongzhi/" target="_blank" >通知</a><a href="https://m.jb51.cc/tag/dizhi/" target="_blank" >地址</a>不为空'],<span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #000000"&gt;    ]);    </span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #0000ff"&gt;if</span> (!<span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$val<a href="https://m.jb51.cc/tag/ID/" target="_blank" >ID</a>ate</span>->check(<span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$data</span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #000000"&gt;)) {        </span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #0000ff"&gt;return</span> ['code' => 0,'msg' => <span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$val<a href="https://m.jb51.cc/tag/ID/" target="_blank" >ID</a>ate</span>-><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #000000"&gt;getError()];    }    </span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$con<a href="https://www.jb51.cc/tag/fig/" target="_blank" >fig</a></span> = self::<span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$a<a href="https://m.jb51.cc/tag/li/" target="_blank" >li</a>pay_con<a href="https://www.jb51.cc/tag/fig/" target="_blank" >fig</a></span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #000000"&gt;;    </span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$con<a href="https://www.jb51.cc/tag/fig/" target="_blank" >fig</a></span>['partner'] = <span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$this</span>-><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #000000"&gt;partner;    </span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$con<a href="https://www.jb51.cc/tag/fig/" target="_blank" >fig</a></span>['seller_<a href="https://m.jb51.cc/tag/ID/" target="_blank" >ID</a>'] = <span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$this</span>-><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #000000"&gt;partner;    </span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$con<a href="https://www.jb51.cc/tag/fig/" target="_blank" >fig</a></span>['key'] = <span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$this</span>-><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #000000"&gt;md5_key;    <a href="https://www.jb51.cc/tag/vend/" target="_blank" >vend</a>or(</span>'a<a href="https://m.jb51.cc/tag/li/" target="_blank" >li</a>pay.a<a href="https://m.jb51.cc/tag/li/" target="_blank" >li</a>pay'<span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #000000"&gt;);    </span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$p<a href="https://www.jb51.cc/tag/ara/" target="_blank" >ara</a>meter</span> =<span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #000000"&gt; [        </span>"service" => <span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$con<a href="https://www.jb51.cc/tag/fig/" target="_blank" >fig</a></span>['service'],"partner" => <span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$con<a href="https://www.jb51.cc/tag/fig/" target="_blank" >fig</a></span>['partner'],"seller_<a href="https://m.jb51.cc/tag/ID/" target="_blank" >ID</a>" => <span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$con<a href="https://www.jb51.cc/tag/fig/" target="_blank" >fig</a></span>['seller_<a href="https://m.jb51.cc/tag/ID/" target="_blank" >ID</a>'],"payment_type" => <span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$con<a href="https://www.jb51.cc/tag/fig/" target="_blank" >fig</a></span>['payment_type'],"notify_url" => <span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$data</span>['notify_url'],"return_url" => <span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$data</span>['return_url'],"anti_phishing_key" => <span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$con<a href="https://www.jb51.cc/tag/fig/" target="_blank" >fig</a></span>['anti_phishing_key'],"exter_invoke_ip" => <span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$con<a href="https://www.jb51.cc/tag/fig/" target="_blank" >fig</a></span>['exter_invoke_ip'],"out_<a href="https://www.jb51.cc/tag/Trad/" target="_blank" >Trad</a>e_no" => <span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$data</span>['out_<a href="https://www.jb51.cc/tag/Trad/" target="_blank" >Trad</a>e_no'],"subject" => <span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$data</span>['subject'],"total_fee" => <span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$data</span>['total_fee'],"body" => <span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$data</span>['body'],"_<a href="https://m.jb51.cc/tag/input/" target="_blank" >input</a>_charset" => <span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$con<a href="https://www.jb51.cc/tag/fig/" target="_blank" >fig</a></span>['<a href="https://m.jb51.cc/tag/input/" target="_blank" >input</a>_charset'],<span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #000000"&gt;    ];    </span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$a<a href="https://m.jb51.cc/tag/li/" target="_blank" >li</a>pay<a href="https://m.jb51.cc/tag/submit/" target="_blank" >submit</a></span> = <span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #0000ff"&gt;new</span> A<a href="https://m.jb51.cc/tag/li/" target="_blank" >li</a>pay<a href="https://m.jb51.cc/tag/submit/" target="_blank" >submit</a>(<span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$con<a href="https://www.jb51.cc/tag/fig/" target="_blank" >fig</a></span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #000000"&gt;);    </span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #0000ff"&gt;return</span> ['code' => 1,'msg' => <span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$a<a href="https://m.jb51.cc/tag/li/" target="_blank" >li</a>pay<a href="https://m.jb51.cc/tag/submit/" target="_blank" >submit</a></span>-><a href="https://www.jb51.cc/tag/buildr/" target="_blank" >buildr</a>equestForm(<span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800080"&gt;$p<a href="https://www.jb51.cc/tag/ara/" target="_blank" >ara</a>meter</span>,"get","确认"<span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #000000"&gt;)];}

}

?>

wx.html在使用微信客户端支付时需要的页面

微信公众号支付
总结

以上是内存溢出为你收集整理的ThinkPHP 5 整合支付宝微信支付(支付宝H5,微信H5、APP支付、公众号支付)全部内容,希望文章能够帮你解决ThinkPHP 5 整合支付宝微信支付(支付宝H5,微信H5、APP支付、公众号支付)所遇到的程序开发问题。

如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。

欢迎分享,转载请注明来源:内存溢出

原文地址: http://outofmemory.cn/langs/1225226.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-06-05
下一篇 2022-06-05

发表评论

登录后才能评论

评论列表(0条)