提交 fa95fcf3 编写于 作者: D devil_gong

pay debug

上级 1e4e8e44
......@@ -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
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册