PHP parse WeChat payment result-PHP source code

Source: Internet
Author: User
PHP parse payment result

wx2421b1c4370ec43b
支付测试
CFT
CNY
Y
10000100
5d2b6c2a8db53831f7eda20af46e531c
oUpF8uMEb4qRXf22hE3X68TekukE
1409811653
SUCCESS
SUCCESS
B552ED6B279343CB493C5DD0D78AB241
10000100
20140903131540
1
JSAPI
1004400740201409030005092168

$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) {// Convert XML to array $ array_data = json_decode (json_encode (simplexml_load_string ($ xml, 'simplexmlelement', LIBXML_NOCDATA), true ); return $ array_data ;}

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.