2

Is it possible to configure Apache or PHP to remove BOM automatically so users do not need to remove BOM manually before uploading scripts.

  • This question may be better suited for [SO], but you need to meet the minimum effort requirement first. Please take a look at the references provided below and ask on [SO] if you are still having troubles. Thank you! – Chris S Nov 20 '12 at 15:14

2 Answers2

1

Assuming by "BOM" you're referring to a Unicode byte-order mark, you could handle it with PHP's output-buffering functions. Have a look at this question on Stack Overflow and adapt-to-taste.

nickgrim
  • 4,466
  • 1
  • 19
  • 28
  • I need PHP do remove BOM from all scripts arround the server by default at the time of displaying output I want to make it as a global configuration so none of users worry about BOM issue. – Fariborz Navidan Nov 19 '12 at 19:51
0

This will be fixed in PHP6. The best way to approach it for each vhost in php5 would be to write your own patch for php.

The following guide goes through writing extentions for php;

Write extensions

  • 1
    Welcome to Server Fault! Whilst this may theoretically answer the question, [it would be preferable](http://meta.stackexchange.com/q/8259) to include the essential parts of the answer here, and provide the link for reference. – Scott Pack Nov 20 '12 at 15:11