我需要執行一個API,它的響應是一個XML。 但是XML值在XML標籤內。php獲取xml內部標籤內容
例如
<example>
<item productid = "1" productname = "xxx" cost = "5.3"/>
<item productid = "2" productname = "yyy" cost = "4.0"/>
<item productid = "3" productname = "zzz" cost = "1.75"/>
</example>
誰能告訴我,我怎樣才能,標籤之間移動,並得到elemnt值 例如:
example:
item:
productid -> 1,
productname -> xxx,
cost -> 5.3
item:
productid -> 2,
productname -> yyy,
cost -> 4.0
item:
productid -> 3,
productname -> zzz,
cost -> 1.75
感謝名單