note 28762 added to function.filetype

From: Date: Thu, 23 Jan 2003 08:41:55 +0000
Subject: note 28762 added to function.filetype
Groups: php.notes 
Request: Send a blank email to php-notes+get-42632@lists.php.net to get a copy of this message
If it's the mime-type you are after, you could parse the mime.types file (in *NIX): $file = file('/etc/mime.types'); foreach($file as $line) { rtrim($line); if (preg_match('/^\#/', $line)) continue; $elms = preg_split('/\s+/', $line); $type = array_shift($elms); foreach ($elms as $elm) { $mime[$elm] = $type; } } Example: $mime[pdf] will return "application/pdf" (or whatever your mime.types file contains). -- http://www.php.net/manual/en/function.filetype.php http://master.php.net/manage/user-notes.php?action=edit+28762 http://master.php.net/manage/user-notes.php?action=delete+28762 http://master.php.net/manage/user-notes.php?action=reject+28762

« previous php.notes (#42632) next »