XmlUtils::convertDomElementToArray()

static array convertDomElementToArray(DOMElement $element, bool $checkPrefix = true)

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 (bar) if the tag also has some nested tags

  • The attributes are converted to keys ()

  • The nested-tags are converted to keys (bar)

Parameters

DOMElement $element A \DomElement instance
bool $checkPrefix Check prefix in an element or an attribute name

Return Value

array A PHP array
doc_Symfony
2016-10-28 06:37:24
Comments
Leave a Comment

Please login to continue.