if (is_error($resp)) { $procResult = $resp; } else { $arr=json_decode(json_encode((array) simplexml_load_string($resp['content'])), true); $xml = '<?xml version="1.0" encoding="utf-8"?>' . $resp['content']; $dom = new \DOMDocument(); if ($dom->loadXML($xml)) { $xpath = new \DOMXPath($dom); $code = $xpath->evaluate('string(//xml/return_code)'); $ret = $xpath->evaluate('string(//xml/result_code)'); if (strtolower($code) == 'success' && strtolower($ret) == 'success') { $procResult = array('errno'=>0,'error'=>'success');; } else { $error = $xpath->evaluate('string(//xml/err_code_des)'); $procResult = array('errno'=>-2,'error'=>$error); } } else { $procResult = array('errno'=>-1,'error'=>'未知错误'); } } return $procResult;
php实现微信公众号企业转账功能(2)
内容版权声明:除非注明,否则皆为本站原创文章。
转载注明出处:https://www.heiqu.com/f793daa275b5001a7246208394dc879b.html