Note Submitter: tzveeka at tzveeka dot com
----
if the file you're trying to get an extension from has
variables attached to it like this one:
jhonson.gif?xxx=1
use this to get the extension without the variables:
// Creating a new file name using the file code:
$path_parts = pathinfo($file_name);
//Lowering all extensions to low caps!
$extension = strtolower($path_parts['extension']);
// if file has variables removing them from extension:
if (!(strpos($extension, "?") === false)) {
$extension = substr($extension,0, strpos($extension,
"?"));
}
--
PHP Notes Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub
.php
|