通过function file_get_contents_utf8($fn) {
$content = file_get_contents($fn);
return mb_convert_encoding($content, 'GB2312',
mb_detect_encoding($content, 'UTF-8, ISO-8859-1', true));
}
$string=file_get_contents_utf8($fn);
echo $string;
获取网页内容然后我应该怎样得到我具体想要的内容呢?谢谢!
$content = file_get_contents($fn);
return mb_convert_encoding($content, 'GB2312',
mb_detect_encoding($content, 'UTF-8, ISO-8859-1', true));
}
$string=file_get_contents_utf8($fn);
echo $string;
获取网页内容然后我应该怎样得到我具体想要的内容呢?谢谢!
或者str_replace();函数
preg_replace
preg_match_all
.......
问题不够详细
$content = curl_init() or die(curl_error()); curl_setopt($content,CURLOPT_URL,"http://www.google.com/"); curl_setopt($content,CURLOPT_RETURNTRANSFER, 1); $result = curl_exec($ch) or die(curl_error()); echo $result; echo curl_error($content); curl_close($content);
请楼主先确定你的curl。dll是加载的