Zitat:
|
Zitat von atom-dragon Kennt jemand eine andere FUnction um den mime_type heraus zu finden ? |
achte doch mal auf der manual seite von php.net auch auf die "User Contributed Notes" der jeweiligen funktionen.
z.b. sieht das von "sunfra at firenze dot net" ganz gut aus:
PHP-Code:
<?php
function mime_content_type_($filename)
{
$mime = array(
'.3dmf' => 'x-world/x-3dmf',
'.a' => 'application/octet-stream',
'.aab' => 'application/x-authorware-bin',
//[... i have to cut, the text is too long :/ ..]
'.xwd' => 'image/x-xwd',
'.xyz' => 'chemical/x-pdb',
'.z' => 'application/x-compressed',
'.zip' => 'application/x-zip-compressed',
'.zoo' => 'application/octet-stream',
'.zsh' => 'text/x-script.zsh',
);
return $mime[strrchr($filename, '.')];
}
?>