我具有由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