mirror of
https://gitee.com/zoujingli/WeChatDeveloper.git
synced 2025-04-06 03:58:03 +08:00
Update Tools.php
This commit is contained in:
parent
0b7ec9fff9
commit
656223cd2a
@ -171,12 +171,14 @@ class Tools
|
|||||||
*/
|
*/
|
||||||
public static function xml3arr($xml)
|
public static function xml3arr($xml)
|
||||||
{
|
{
|
||||||
if (xml_parse($parser = xml_parser_create(), $xml, true)) {
|
$parser = xml_parser_create();
|
||||||
return json_decode(json_encode(simplexml_load_string($xml)), true);
|
if (xml_parse($parser, $xml, true)) {
|
||||||
}
|
return self::xml2arr($xml);
|
||||||
if (is_resource($parser)) xml_parser_free($parser);
|
} else {
|
||||||
|
xml_parser_free($parser);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 数组转xml内容
|
* 数组转xml内容
|
||||||
|
Loading…
x
Reference in New Issue
Block a user