Skip to content

Instantly share code, notes, and snippets.

View Bunnyfield's full-sized avatar

Jo Hasenau Bunnyfield

View GitHub Profile
function convertXmlObjToArr(\SimpleXMLElement $node) : array
{
$element = [
'@name' => strtolower((string)$node->getName()),
'@attributes' => []
];
$attributes = $node->attributes();
foreach ($attributes as $attributeName => $attributeValue)
{
$attribName = strtolower(trim((string)$attributeName));