PHP Headers and Popular Mime Types

Create a Basic Web Service Using PHP, MySQL, XML, and JSON illustrates, even though a file’s extension ends in PHP, you can still tell the browser that you’re outputting a different content type. Here are a few of the more popular content types used on the internet.

Atom

CSS

JavaScript

JPEG Image

JSON

PDF

RSS

Text (Plain)

XML

Just because a file ends in .PHP doesn’t mean it responds with XHTML — respond however you’d like!

One thought on “PHP Headers and Popular Mime Types

Leave a Reply

Your email address will not be published. Required fields are marked *

CAPTCHA