fwrite() and UTF8

后端 未结 8 983
隐瞒了意图╮
隐瞒了意图╮ 2020-12-05 16:02

I am creating a file using php fwrite() and I know all my data is in UTF8 ( I have done extensive testing on this - when saving data to db and outputting on normal webpage a

8条回答
  •  没有蜡笔的小新
    2020-12-05 16:34

    //add BOM to fix UTF-8 in Excel
    fputs($fp, $bom =( chr(0xEF) . chr(0xBB) . chr(0xBF) ));
    

    I find this piece works for me :)

提交回复
热议问题