note 80395 added to function.filetype

From: Date: Mon, 14 Jan 2008 04:15:28 +0000
Subject: note 80395 added to function.filetype
Groups: php.notes 
Request: Send a blank email to php-notes+get-135082@lists.php.net to get a copy of this message
I find that if you're trying to get the extension of a file, this method isn't the what you want. I've written a function instead: <?php function fileExtension($file) { $fileExp = explode('.', $file); // make array off the periods $filetype = $fileExp[count($fileExp) -1]; // file extension will be last index in array, -1 for 0-based indexes } ?> ---- Server IP: 69.147.83.197 Probable Submitter: 75.69.86.143 ---- Manual Page -- http://www.php.net/manual/en/function.filetype.php Edit -- https://master.php.net/note/edit/80395 Del: integrated -- https://master.php.net/note/delete/80395/integrated Del: useless -- https://master.php.net/note/delete/80395/useless Del: bad code -- https://master.php.net/note/delete/80395/bad+code Del: spam -- https://master.php.net/note/delete/80395/spam Del: non-english -- https://master.php.net/note/delete/80395/non-english Del: in docs -- https://master.php.net/note/delete/80395/in+docs Del: other reasons-- https://master.php.net/note/delete/80395 Reject -- https://master.php.net/note/reject/80395 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#135082) next »