晕倒!!SysTem128的方法是可以的。你自己就不会做一下修改!?$html = '<?xml version="1.0" encoding="utf8"?> 
<data> 
<d count="1" p="40" sort="DIY_1"></d> 
<d count="1" p="40" sort="DIY_2"></d> 
</data>';$doc = new DOMDocument();
//echo var_dump($doc);//浏览器输出object(domdocument)(0) { }
$doc->loadXML($html);
$tags = $doc->getElementsByTagName('d');
foreach ($tags as $tag)
{
    echo $tag->getAttribute('count').'';
    echo $tag->getAttribute('p').'';
    echo $tag->getAttribute('what').'';
    echo $tag->getAttribute('who').'';
    echo $tag->getAttribute('why').'';
    echo $tag->getAttribute('type').'';
    echo $tag->getAttribute('sort').'';
    echo $tag->getAttribute('s').'';
    echo $tag->nodeValue.'<br>';
}要保证你的信息是utf8的不然中文会乱码、上面的可以解出来