Findexts Jul 8th, 2011 | Comments 1 2 3 4 5 6 7 8 <?php Function findexts ($filename) { $filename = strtolower($filename); $exts = split("[/\\.]", $filename); $n = count($exts)-1; $exts = $exts[$n]; return $exts; } Clever! I see your custom function and I raise you pathinfo($filename, PATHINFO_EXTENSION).