PHP怎么解析微信支付结果返回的xml
1个回答
展开全部
foreach ($_GET as $key=>$value)
{
logger("Key: $key; Value: $value");
}
$postStr = $GLOBALS["HTTP_RAW_POST_DATA"];
logger($postStr);
header('Content-type:application/xml');
$str = preg_match_all("/(?:\<out\_trade\_no\>\<\!\[CDATA\[)(.*?)(?:\]\]\>\<\/out\_trade\_no\>)/i",decodeUnicode($postStr), $out);
$list = execute("update juyi_orders_form set status='1' where order_numbers='{$out['1']['0']}'");
if (isset($_GET)){
echo "success";
}
//日志记录
function logger($log_content)
{
$max_size = 100000;
$log_filename = "log.xml";
if(file_exists($log_filename) and (abs(filesize($log_filename)) > $max_size)){unlink($log_filename);}
file_put_contents($log_filename, date('H:i:s')." ".$log_content."\r\n", FILE_APPEND);
}
{
logger("Key: $key; Value: $value");
}
$postStr = $GLOBALS["HTTP_RAW_POST_DATA"];
logger($postStr);
header('Content-type:application/xml');
$str = preg_match_all("/(?:\<out\_trade\_no\>\<\!\[CDATA\[)(.*?)(?:\]\]\>\<\/out\_trade\_no\>)/i",decodeUnicode($postStr), $out);
$list = execute("update juyi_orders_form set status='1' where order_numbers='{$out['1']['0']}'");
if (isset($_GET)){
echo "success";
}
//日志记录
function logger($log_content)
{
$max_size = 100000;
$log_filename = "log.xml";
if(file_exists($log_filename) and (abs(filesize($log_filename)) > $max_size)){unlink($log_filename);}
file_put_contents($log_filename, date('H:i:s')." ".$log_content."\r\n", FILE_APPEND);
}
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询