1
我嘗試了很多,但我無法弄清楚。我有這樣的:如何獲取SimpleXMLElement對象的最後一個值?
SimpleXMLElement Object (
[BrowseNodeId] => 10829411
[Name] => Römertöpfe
[Ancestors] => SimpleXMLElement Object
(
[BrowseNode] =>
SimpleXMLElement Object
(
[BrowseNodeId] => 3311941
[Name] => Töpfe & Pfannen
[Ancestors] => SimpleXMLElement Object
(
[BrowseNode] => SimpleXMLElement Object
(
[BrowseNodeId] => 3094896031
[Name] => Kochen
[Ancestors] => SimpleXMLElement Object
(
[BrowseNode] => SimpleXMLElement Object
(
[BrowseNodeId] => 3169011
[Name] => Kategorien
[IsCategoryRoot] => 1
[Ancestors] => SimpleXMLElement Object
(
[BrowseNode] => SimpleXMLElement Object
(
[BrowseNodeId] => 3167641
[Name] => Küche, Haushalt & Wohnen
)))))))))
我需要它的最後的值(粗體之一):
[名] =>庫車,Haushalt & Wohnen的
但我不知道,我怎麼能讀出最後的價值。有沒有人有這個解決方案?
分享您的XML來代替。 –