Converts a \DomElement object to a PHP array.
The following rules applies during the conversion:
- Each tag is converted to a key value or an array
if there is more than one "value"
- The content of a tag is set under a "value" key (<foo>bar</foo>)
if the tag also has some nested tags
- The attributes are converted to keys (<foo foo="bar"/>)
- The nested-tags are converted to keys (<foo><foo>bar</foo></foo>)
Parameters
\DomElement $element A \DomElement instance:
Return value
array A PHP array
File
- drupal/core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Loader/XmlFileLoader.php, line 414
Class
- XmlFileLoader
- XmlFileLoader loads XML files service definitions.
Namespace
Symfony\Component\DependencyInjection\Loader
Code
public static function convertDomElementToArray(\DomElement $element) {
return XmlUtils::convertDomElementToArray($element);
}