O'Reilly logo

Core PHP Programming: Using PHP to Build Dynamic Web Sites by Leon Atkinson

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Setting Document Type

By default, PHP sends an HTTP header specifying the document as being HTML. The Content-Type header specifies the MIME type text/html, and the browser interprets the code as HTML. Sometimes you will wish to create other types of documents with PHP. You will learn in Chapter 19, "Generating Graphics," about creating images, which may require an image/png content type. MIME types are administered by IANA, the Internet Assigned Numbers Authority. You can find a list of official media types at <http://www.isi. edu/in-notes/iana/assignments/media-types/>.

At times, you may wish to take advantage of how browsers react to different types of content. For example, text/plain displays in a fixed-width font with no interpretation of ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required