Public paste
mime
By: fruffl | Date: Mar 4 2010 20:07 | Format: PHP | Expires: never | Size: 1.31 KB | Hits: 1003

  1. <?php
  2.                 public function mime($type)
  3.                 {      
  4.                         $mime = array(
  5.                                 'phps'          => 2, // pass to highlight_file()
  6.                                 'c'             => 'text/plain',
  7.                                 'cc'            => 'text/plain',
  8.                                 'cpp'           => 'text/plain',
  9.                                 'c++'           => 'text/plain',
  10.                                 'css'           => 'text/css',
  11.                                 'dtd'           => 'text/plain',
  12.                                 'h'             => 'text/plain',
  13.                                 'log'           => 'text/plain',
  14.                                 'rng'           => 'text/plain',
  15.                                 'txt'           => 'text/plain',
  16.                                 'xsd'           => 'text/plain',
  17.                                 'php'           => 1, // parse as PHP
  18.                                 'inc'           => 1, // parse as PHP
  19.                                 'avi'           => 'video/avi',
  20.                                 'bmp'           => 'image/bmp',
  21.                                 'css'           => 'text/css',
  22.                                 'gif'           => 'image/gif',
  23.                                 'htm'           => 'text/html',
  24.                                 'html'          => 'text/html',
  25.                                 'htmls'         => 'text/html',
  26.                                 'xhtml'         => 'text/html',
  27.                                 'ico'           => 'image/x-ico',
  28.                                 'jpe'           => 'image/jpeg',
  29.                                 'jpg'           => 'image/jpeg',
  30.                                 'jpeg'          => 'image/jpeg',
  31.                                 'js'            => 'application/x-javascript',
  32.                                 'midi'          => 'audio/midi',
  33.                                 'mid'           => 'audio/midi',
  34.                                 'mod'           => 'audio/mod',
  35.                                 'mov'           => 'movie/quicktime',
  36.                                 'mp3'           => 'audio/mp3',
  37.                                 'mpg'           => 'video/mpeg',
  38.                                 'mpeg'          => 'video/mpeg',
  39.                                 'pdf'           => 'application/pdf',
  40.                                 'png'           => 'image/png',
  41.                                 'swf'           => 'application/shockwave-flash',
  42.                                 'tif'           => 'image/tiff',
  43.                                 'tiff'          => 'image/tiff',
  44.                                 'wav'           => 'audio/wav',
  45.                                 'xbm'           => 'image/xbm',
  46.                                 'xml'           => 'text/xml',
  47.                         );