PHP写入WRITE编码为UTF8的文件的实现代码_PHP教程
程序员文章站
2022-04-13 16:45:12
...
$f=fopen("test.txt", "wb");
$text=utf8_encode("顨!");
// adding header
$text="\xEF\xBB\xBF".$text;
fputs($f, $text);
fclose($f);
?>
$text=utf8_encode("顨!");
// adding header
$text="\xEF\xBB\xBF".$text;
fputs($f, $text);
fclose($f);
?>