我有一个文件 test.xml
<?xml version="1.0" encoding="UTF-8"?>
<item>
<dc:creator><![CDATA[hello world]]></dc:creator>
</item>
和代码php
$doc = new DOMDocument();
$doc->load('test.xml');
$items = $doc->getElementsByTagName('item');
foreach ($items as $item) {
$authors = $item->getElementsByTagName( "dc:creator" );
$author = $authors->item(0)->nodeValue;
echo $author;
}
=> error can't get value, 如何得到这个,结果是“hello world”