PHP Headers e MIME Types

May 29th, 2009 | Tags: , , ,

Opa Pessoal, eu nunca decoro esses Headers e MIME Types e sempre que preciso usa-los é uma pesquisa no google.
Resolvi postar aqui pra facilitar a minha vida, e de quem está procurando por isso…

Atom

1
header('Content-type: application/atom+xml');

CSS

1
header('Content-type: text/css');

Javascript

1
header('Content-type: text/javascript');

JPEG Image

1
header('Content-type: image/jpeg');

JSON

1
header('Content-type: application/json');

PDF

1
header('Content-type: application/pdf');

RSS

1
header('Content-Type: application/rss+xml; charset=ISO-8859-1');

Text (Plain)

1
header('Content-type: text/plain');

XML

1
header('Content-type: text/xml');

Espero ter ajudado!

Abraços ;)

Vi em: http://davidwalsh.name/php-header-mime


  1. João
    June 19th, 2009 at 05:00
    Reply | Quote | #1

    Ótimo, só que na próxima, cite a fonte de onde retirou o artigo (http://davidwalsh.name/php-header-mime).

    • June 19th, 2009 at 05:35
      Reply | Quote | #2

      Sempre cito as fontes, leia os outros posts caso tenha duvida… se eu não citei deste post, ou esqueci, ou não lembrei.. rsrs Obrigado por lembrar.