How to setup content type header using PHP

August 5, 2008

Content type header is very important for SEO resons, but some browser eg: Mozilla don’t accept content-type correctly when writed by regular method.

Hence you have to set content type using server setting also (eg using PHP). Server side setting will allow you to set default content type and encoding for all documents.

You may also set content type and encoding document wise using server side scripts. By using PHP, you could add this line at the very top of script:

header (’Content-type: text/html; charset=iso-8859-1?);