function _emapi_unserialize_xml in Embedded Media Field 6.3
Recursively converts a SimpleXMLElement object into an array.
Parameters
$xml: The original XML object.
1 call to _emapi_unserialize_xml()
- _emapi_retrieve_xml in emapi/
includes/ emapi.xml.inc - A wrapper around simplexml to retrieve a given XML file.
File
- emapi/
includes/ emapi.xml.inc, line 75 - XML data retrieval and storage API for Embedded Media API.
Code
function _emapi_unserialize_xml($xml) {
if ($xml instanceof SimpleXMLElement) {
$xml = (array) $xml;
}
if (is_array($xml)) {
foreach ($xml as $key => $item) {
$xml[$key] = _emapi_unserialize_xml($item);
}
}
return $xml;
}