Possible Duplicate:
“Warning: Headers already sent” in PHP
When I create my php files with utf-8 bom, the header() function doesn't work because the bom chars are sent before the http headers.
- Does it mean that we shouldn't use bom in php source files?
- Is it a feature or bug?
- And what are your advices when working with utf-8 encoded php source files?
BOM is actual data sent to the browser and however the browser will ignore it, once it is sent you are unable to send headers unless you use output buffering. In general do not use BOM. If your text editor you work with requires BOM, then change the editor to something less outdated.
<?php
tag first:--
--