http://php.net/manual/en/function.fwrite.php
if you have to write a file in UTF-8 format, you have to add an header to the file like this :
$f=fopen("test.txt", "wb");
$text=utf8_encode("éaè!");
// adding header
$text="\xEF\xBB\xBF".$text;
fputs($f, $text);
fclose($f);
?>
BOM可以不用寫入沒關係XD
回覆刪除