我具有由web服務所生成的以下XML數據PHP讀取XML屬性
<?xml version="1.0" encoding="UTF-8"?>
<rsp xmlns="http://worldcat.org/xid/isbn/" stat="ok">
<isbn oclcnum="263710087 491996179 50279560 60857040 429386124 44597307" lccn="00131084" form="AA BC" year="2002" lang="eng" ed="1st American ed." title="Harry Potter and the goblet of fire" author="J.K. Rowling." publisher="Scholastic Inc." city="New York [u.a.]" url="http://www.worldcat.org/oclc/263710087?referer=xid">9780439139601</isbn>
</rsp>
我需要在「ISBN」標籤讀取數據,更具體地,屬性「標題」的值。我將如何在PHP中執行此操作。
感謝
這取決於你在xml中有多少個isbn標籤。只會得到你第一個標籤元素的標題。 我想你應該使用像戈登建議的東西。 – Youssef 2010-06-21 15:04:51