You are here

function _media_unserialize_xml in D7 Media 7

Recursively converts a SimpleXMLElement object into an array.

Parameters

$xml: The original XML object.

1 call to _media_unserialize_xml()
_media_retrieve_xml in includes/media.xml.inc
A wrapper around simplexml to retrieve a given XML file.

File

includes/media.xml.inc, line 71
XML data retrieval and storage API for Media.

Code

function _media_unserialize_xml($xml) {
  if ($xml instanceof SimpleXMLElement) {
    $xml = (array) $xml;
  }
  if (is_array($xml)) {
    foreach ($xml as $key => $item) {
      $xml[$key] = _media_unserialize_xml($item);
    }
  }
  return $xml;
}