如何在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);
}
但是ä,ö和ü显示为?
感谢您的帮助