程序没问题,但这个xml貌似不标准Within a CDATA section, only the CDEnd string is recognized as up, so that left angle brackets and ampersands may occur in their literal form; they need not (and cannot) be escaped using "&lt;" and "&amp;". CDATA sections cannot nest.http://www.w3.org/TR/2000/REC-xml-20001006#NT-CDEnd==================================改写了一下你看看这两个好像有区别 注意看 “<![CDATA[” 的写法,怪异的标准 结尾的“]]>” 就没有影响了程序那里 ,循环体里加上
echo $lastname->item(0)->firstChild->nodeType;
也能看出两个的区别==========正常的===========
<?xml version='1.0' encoding='GB2312'?>
<sina>
<aa>sina</aa>
<bb><![CDATA[
sdfsdf
sdf
sd
fs
]]>
</bb>
</sina>============不正常的==============
<?xml version='1.0' encoding='GB2312'?>
<sina>
<aa>sina</aa>
<bb>
<![CDATA[
sdfsdf
sdf
sd
fs
]]>
</bb>
</sina>