Home > php教程 > PHP源码 > PHP解析微信支付结果

PHP解析微信支付结果

PHP中文网
Release: 2016-05-23 09:53:58
Original
1934 people have browsed it

PHP解析微信支付结果

   
   
   
   
   
   
   
   
   
   
   
   
   
   
   1
   
   

$msg = array();
 
$postStr = file_get_contents('php://input');
 
$msg = (array)simplexml_load_string($postStr, 'SimpleXMLElement', LIBXML_NOCDATA);
Copy after login
$msg = array();
 
$postStr = $GLOBALS["HTTP_RAW_POST_DATA"];
 
$msg = (array)simplexml_load_string($postStr, 'SimpleXMLElement', LIBXML_NOCDATA);
Copy after login
public function xmlToArray($xml)
{       
   //将XML转为array        
   $array_data = json_decode(json_encode(simplexml_load_string($xml, 'SimpleXMLElement', LIBXML_NOCDATA)), true);       
   return $array_data;
}
Copy after login
Related labels:
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Latest Articles by Author
Popular Recommendations
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template