Jump to content

PHP files with BOM or without BOM ?


Rommeo

Recommended Posts

I have told that the php files I was working on contains BOM by default cause of the editor I m using. I have installed other editor that can create php files without BOM.

 

So my question is  what's the difference between 2 files, one with BOM and other without BOM ? Any problems I may face for long term usage ? Which one is better to use ?

 

Link to comment
https://forums.phpfreaks.com/topic/222671-php-files-with-bom-or-without-bom/
Share on other sites

- UTF-8 is backwards compatible with regular ASCII in the 0-127 character range. That includes everything on the keyboard (and more). If you don't use Unicode characters >127 directly in your file then there won't be any problems anywhere. IIRC most UTF-8 encoded characters use character codes that are valid in PHP (like for variable or function names) so even if you do want Unicode stuff, you can probably get away with it - even without the BOM. Worst case: you use "\x??" and HTML entities.

 

- As the last comment says, and as I see on my PHP/Win 5.3.2, there is no multibyte support from the Zend engine.

 

- There is no PHP 6 anymore. Don't wait for it.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.