php解析微信支付结果
<xml>
<appid><![cdata[wx2421b1c4370ec43b]]></appid>
<attach><![cdata[支付测试]]></attach>
<bank_type><![cdata[cft]]></bank_type>
<fee_type><![cdata[cny]]></fee_type>
<is_subscribe><![cdata[y]]></is_subscribe>
<mch_id><![cdata[10000100]]></mch_id>
<nonce_str><![cdata[5d2b6c2a8db53831f7eda20af46e531c]]></nonce_str>
<openid><![cdata[oupf8umeb4qrxf22he3x68tekuke]]></openid>
<out_trade_no><![cdata[1409811653]]></out_trade_no>
<result_code><![cdata[success]]></result_code>
<return_code><![cdata[success]]></return_code>
<sign><![cdata[b552ed6b279343cb493c5dd0d78ab241]]></sign>
<sub_mch_id><![cdata[10000100]]></sub_mch_id>
<time_end><![cdata[20140903131540]]></time_end>
<total_fee>1</total_fee>
<trade_type><![cdata[jsapi]]></trade_type>
<transaction_id><![cdata[1004400740201409030005092168]]></transaction_id>
</xml>
$msg = array();
$postStr = file_get_contents('php://input');
$msg = (array)simplexml_load_string($postStr, 'SimpleXMLElement', LIBXML_NOCDATA);$msg = array(); $postStr = $GLOBALS["HTTP_RAW_POST_DATA"]; $msg = (array)simplexml_load_string($postStr, 'SimpleXMLElement', LIBXML_NOCDATA);
public function xmlToArray($xml)
{
//将XML转为array
$array_data = json_decode(json_encode(simplexml_load_string($xml, 'SimpleXMLElement', LIBXML_NOCDATA)), true);
return $array_data;
}
微信是一款手机通信软件,支持通过手机网络发送语音短信、视频、图片和文字。微信可以单聊及群聊,还能根据地理位置找到附近的人,带给大家全新的移动沟通体验,有需要的小伙伴快来保存下载体验吧!
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号