修改xml3arr

This commit is contained in:
Anyon 2020-04-26 11:22:09 +08:00
parent 656223cd2a
commit 5cf008c374

View File

@ -171,13 +171,8 @@ class Tools
*/ */
public static function xml3arr($xml) public static function xml3arr($xml)
{ {
$parser = xml_parser_create(); $state = xml_parse($parser = xml_parser_create(), $xml, true);
if (xml_parse($parser, $xml, true)) { return xml_parser_free($parser) && $state ? self::xml2arr($xml) : false;
return self::xml2arr($xml);
} else {
xml_parser_free($parser);
return false;
}
} }
/** /**