Reputation: 1133
Does PHP have such options when saving file?
Upvotes: 1
Views: 1487
Reputation: 1298
It works for me. Thanks!
$file = fopen("arquivos_gerados/teste.html","w");
fwrite($file,chr(0xEF).chr(0xBB).chr(0xBF).$content);
fclose($file);
Upvotes: 0
Reputation: 449395
PHP will never automatically append a BOM when writing a file. You would have to add it yourself:
$filecontents = chr(0xEF).chr(0xBB).chr(0xBF).$mycontents;
Upvotes: 4