PDA

View Full Version : [PHP] Estrarre key di un'array creato con simplexml_load_file


[>>VK<<]
23-02-2013, 21:01
Mi sapreste dire come posso fare per recupereare le [key] di un'array creato con la funzione simplexml_load_file?

SimpleXMLElement Object
(
[Day] => Array
(
[0] => SimpleXMLElement Object
(
[@attributes] => Array
(
[Num] => 4553
)

[Date] => 220412
[Energy] => 2
)

[1] => SimpleXMLElement Object
(
[@attributes] => Array
(
[Num] => 4553
)

[Date] => 170612
[Energy] => 403
)

[2] => SimpleXMLElement Object
(
[@attributes] => Array
(
[Num] => 4554
)

[Date] => 180612
[Energy] => 1500
)

[3] => SimpleXMLElement Object
(
[@attributes] => Array
(
[Num] => 4555
)

[Date] => 220412
[Energy] => 2
)

[4] => SimpleXMLElement Object
(
[@attributes] => Array
(
[Num] => 4556
)

[Date] => 170612
[Energy] => 403
)

[5] => SimpleXMLElement Object
(
[@attributes] => Array
(
[Num] => 4557
)

[Date] => 180612
[Energy] => 1500
)

)

)

in pratica mi servirebbe raggiungere e estrarre gli indici dell'array contenuto in [Day] : [0] [1] [2] [3] [4] [5] , il tutto dovrebbe avvenire in un ciclo.

:help::help: