I load a xml-file like this:
$xml = simplexml_load_file('test.xml');
Then I created an array:
$array= $xml->xpath('//objektart');
The content of the array looks like this:
Array
(
[0] => SimpleXMLElement Object
(
[haus] => SimpleXMLElement Object
(
[@attributes] => Array
(
[haustyp] => ZWEIFAMILIENHAUS
)
)
)
)
Now I want to get the name of the SimpleXMLElement Object = "haus" and the attributes = "haustyp" and "ZWEIFAMILIENHAUS" for outputtting them on a website.
The values like "haus", "haustyp" and "ZWEIFAMILIENHAUS" can vary, so i cant rely on these "keywords" to access them. Just the method of creating the array from the xml-element stays the same.
Can anyone please point me to the right direction here? I'm stuck for hours testing without any result...