You are here

function _emfield_unserialize_xml in Embedded Media Field 6.2

Same name and namespace in other branches
  1. 6.3 includes/emfield.xml.inc \_emfield_unserialize_xml()

Recursively converts a SimpleXMLElement object into an array.

Parameters

$xml: The original XML object.

1 call to _emfield_unserialize_xml()
_emfield_retrieve_xml in includes/emfield.xml.inc
A wrapper around simplexml to retrieve a given XML file.

File

includes/emfield.xml.inc, line 75
XML data retrieval and storage API for Embedded Media Field.

Code

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