file_get_contents()PHP

时间:2010-03-21 14:52:37

标签: php encoding

为什么我在回声中遇到charset问题?

$url = "http://ru.wikipedia.org";
$site=file_get_contents($url);
echo $site;

1 个答案:

答案 0 :(得分:3)

尝试将header('Content-Type: text/html;charset=utf-8');放在文件的开头