Created
November 3, 2014 21:55
-
-
Save timkelty/2a221ac232e5ecf1b090 to your computer and use it in GitHub Desktop.
Get all element attributes and content
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$attributes = array_merge($element->getAttributes(), $element->getContent()->getAttributes()); | |
array_walk($attributes, function(&$value, $handle) use ($element, $attributes) { | |
$value = !empty($element->$handle) ? $element->$handle : $attributes[$handle]; | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment