use:
$xml = simplexml_load_string($content); $array = json_decode(json_encode((array) $xml), 1);
When parsing XML into an array in this way,
For:
and
content
can be parsed correctly, but for this:
content
You cannot get the name attribute, but you can only get the content content.
Is there any good way to deal with this problem?