如何在创建的文件上设置UTF-8

时间:2014-07-09 09:50:31

标签: php utf-8

如何在php创建的文件上将字符集设置为UTF-8?我像这样创建我的文件:

if(!file_exists("games/".strtolower($dir)."/index.php")) {
        $create_index = fopen("games/".strtolower($dir)."/index.php", "w");
        $name = $row['name'];
        $content  = mb_convert_encoding($content,'UTF-8');
        $string = "
        <?php
        include '../../config.php';
        include('../../default_theme.php');
        setTitle(\"".$name."\");
        show(\"".$name."\");
        ";
        fwrite($create_index, $content);
        fwrite($create_index, $string);
        fclose($create_index);
    }

但是ä,ö和ü显示为?

感谢您的帮助

0 个答案:

没有答案