--------- The following references Google resources ---------------------
The output CSV file does not contain Bom.
What is Bom?
There is a character named "Zero Width no-break space" in the UCS encoding, and its encoding is feff. Fffe does not exist in the UCs, so it should not appear in actual transmission. We recommend that you first transmit the character "Zero Width no-break space" before transmitting the byte stream ". In this way, if the receiver receives feff, it indicates that the byte stream is big-Endian; if it receives fffe, it indicates that the byte stream is little-Endian. Therefore, the character "Zero Width no-break space" is also called Bom.
The UTF-8 does not need BOM to indicate the byte order, but BOM can be used to indicate the encoding method. The UTF-8 code for the character "Zero Width no-break space" is ef bb bf. So if the receiver receives a byte stream starting with ef bb bf, it will know that this is UTF-8 encoding.
Windows uses BOM to mark the encoding of text files.
So how to output BOM in PHP?
Before all content is output
Print (CHR (0xef). CHR (0xbb). CHR (0xbf ));
------------------------ Reference end --------------------------