代码是这样的:
[code="php"]<?php
$url = "http://news.sise.com.cn/show.php?id-1611.html";
//$html = file_get_contents($url);
$html=iconv("gb2312", "utf-8",file_get_contents($url));
//echo $html;
$doc=new DomDocument('1.0','utf-8');
$doc->loadHTML($html);
$xpath=new DOMXpath($doc);
$flag = "//p[@class='MsoNormal']";
foreach($xpath->query($flag) as $node){
$link = $node->nodeValue;
echo $link . "\n";
}
?>[/code]
帮忙看看怎样修改才能不乱码?