Login   Register  
PHP Classes
elePHPant
Icontem

File: example.php

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  Classes of Kai Ming Choi  >  File MIME Class  >  example.php  >  Download  
File: example.php
Role: Example script
Content type: text/plain
Description: example
Class: File MIME Class
Determine the MIME type from a file name extension
Author: By
Last change:
Date: 2010-07-09 09:59
Size: 411 bytes
 

Contents

Class file image Download
<pre><?php
//File MIME Class Exampke
include "mime.class.php";

$mime = new MIME();

//directly
echo $mime->EXTtoMIME("txt")."\n";
echo 
$mime->EXTtoMIME("doc")."\n";
echo 
$mime->EXTtoMIME("jpg")."\n";

echo 
"\n\n\n";

//return array
print_r($mime->MIMEtoEXT("application/mime"))."\n";
print_r($mime->MIMEtoEXT("text/css"))."\n";
print_r($mime->MIMEtoEXT("text/html"))."\n";    //multiple values
?>