src/Gateways/Wechat/Support.php
public static function fromXml($xml): array
    {
        if (!$xml) {
            throw new InvalidArgumentException('Convert To Array Error! Invalid Xml!');
        }

        libxml_disable_entity_loader(true);

        return json_decode(json_encode(simplexml_load_string($xml, 'SimpleXMLElement', LIBXML_NOCDATA), JSON_UNESCAPED_UNICODE), true);
    }
public static function fromXml($xml): array
    {
        if (!$xml) {
            throw new InvalidArgumentException('Convert To Array Error! Invalid Xml!');
        }

        libxml_disable_entity_loader(true);

        return json_decode(json_encode(simplexml_load_string($xml, 'SimpleXMLElement', LIBXML_NOCDATA), JSON_UNESCAPED_UNICODE), true);
    }
public static function fromXml ( $ xml ) : array { if ( ! $ xml ) { throw new InvalidArgumentException ( 'Convert To Array Error! Invalid Xml!' ) ; } libxml_disable_entity_loader ( true ) ; return json_decode ( json_encode ( simplexml_load_string ( $ xml , 'SimpleXMLElement' , LIBXML_NOCDATA ) , JSON_UNESCAPED_UNICODE ) , true ) ; }
Convert xml to array.

@author yansongda <me@yansongda.cn>

@param string $xml

@throws InvalidArgumentException

@return array
Convert xml to array .