文章目录
These functions/constants are available as of PHP 5.1.0, and the following core extensions rely on this libxml extension:
DOM
,
libxml
,
SimpleXML
,
SOAP
,
WDDX
,
XSL
,
XML
,
XMLReader
,
XMLRPC
和XMLWriter
.
转换方法
- SimpleXMLElement 对象
- simplexml_load_file() 方法
SimpleXMLElement 介绍
代码示例
以下是带有命名空间的xml文档
$xml = <<<XML
<ns:getJournalsResponse xmlns:ns="http://jane.erasmusmc.org" xmlns:ax21="http://dataClasses.jane.erasmusmc.org/xsd">
<ns:return xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ax21:Journal">
<ax21:score>0.09468732609088781</ax21:score>
<ax21:ai>10.7</ax21:ai>
<ax21:airank>100</ax21:airank>
<ax21:issn>0149-2195</ax21:issn>
<ax21:journalAbbr>MMWR-MORBID MORTAL W</ax21:journalAbbr>
<ax21:medlineIndexed>true</ax21:medlineIndexed>
<ax21:name>MMWR. Morbidity and mortality weekly repor