pay debug

feat/task1-c-wallet
devil_gong 2019-01-07 14:23:54 +08:00
parent 1e4e8e4433
commit fa95fcf3d6
1 changed files with 23 additions and 1 deletions

View File

@ -254,11 +254,33 @@ class WeixinMini
*/
private function XmlToArray($xml)
{
if(!Xml_Parser($xml)) return '';
if(!$this->XmlParser($xml)) return '';
return json_decode(json_encode(simplexml_load_string($xml, 'SimpleXMLElement', LIBXML_NOCDATA)), true);
}
/**
* 判断字符串是否为xml格式
* @author Devil
* @blog http://gong.gg/
* @version 1.0.0
* @date 2019-01-07
* @desc description
* @param [string] $string [字符串]
*/
function XmlParser($string)
{
$xml_parser = xml_parser_create();
if(!xml_parse($xml_parser, $string, true))
{
xml_parser_free($xml_parser);
return false;
} else {
return (json_decode(json_encode(simplexml_load_string($string)),true));
}
}
/**
* [HttpRequest 网络请求]
* @author Devil