I tak właśnie robię. Mam taki obiekt:
Cytat
SimpleXMLElement Object ( [staff-type] => alternate [staff-lines] => 6 [staff-tuning] => Array ( [0] => SimpleXMLElement Object ( [@attributes] => Array ( [line] => 1 ) [tuning-step] => E [tuning-octave] => 4 ) [1] => SimpleXMLElement Object ( [@attributes] => Array ( [line] => 2 ) [tuning-step] => B [tuning-octave] => 3 ) [2] => SimpleXMLElement Object ( [@attributes] => Array ( [line] => 3 ) [tuning-step] => G [tuning-octave] => 3 ) [3] => SimpleXMLElement Object ( [@attributes] => Array ( [line] => 4 ) [tuning-step] => D [tuning-octave] => 3 ) [4] => SimpleXMLElement Object ( [@attributes] => Array ( [line] => 5 ) [tuning-step] => A [tuning-octave] => 2 ) [5] => SimpleXMLElement Object ( [@attributes] => Array ( [line] => 6 ) [tuning-step] => D [tuning-octave] => 2 ) ) )
I chce się dobrać do tej tablicy "staff-tuning". Jeżeli zrobię poprzez $obiekt->{'staff-tuning'}, pobiera mi tylko ostatni element. Co robię nie tak?