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
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.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.