How do I save file in UTF-8 without BOM
The byte order mark (BOM) is a Unicode character that sometimes causes problems in PHP scripts (especially in includes), because it can cause HTTP headers to be sent to the browser prematurely.
To make sure your PHP files do not have the BOM, follow these steps:
- Download and install this powerful free text editor: Notepad++
- Open the file you want to verify/fix in Notepad++
- In the top menu select Encoding > Convert to UTF-8 (option without BOM)
- Save the file
That's it, you should now have a valid file in UTF-8 encoding without the byte order mark.