0
我下載的網頁用XML代碼:如何循環SimpleXML對象?
$xml = simplexml_load_file($page);
的結果是:
SimpleXMLElement Object
(
[@attributes] => Array
(
[Message] => Success
[Date] => 0001-01-01T00:00:00
)
[FUNDAMENTALS] => SimpleXMLElement Object
(
[FUNDAMENTAL] => Array
(
[0] => SimpleXMLElement Object
(
[@attributes] => Array
(
[Symbol] => AAA
[Name] => Description AAA
)
)
[1] => SimpleXMLElement Object
(
[@attributes] => Array
(
[Symbol] => BBB
[Name] => Description BBB
)
)
)
)
)
我要讀每一個[符號] [名],我該怎麼辦?
是這是最簡單的。 Hooray爲數組acces。 請注意數據類型(在成員中有數組,或反之亦然)。你可以重鑄他們陣列... – Deefjuh 2010-08-05 13:45:15