Skip to content

Instantly share code, notes, and snippets.

@jefferyrdavis
Last active December 19, 2015 17:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jefferyrdavis/5992262 to your computer and use it in GitHub Desktop.
Save jefferyrdavis/5992262 to your computer and use it in GitHub Desktop.
Snippit: PHP: Find the extenstion of a filename
<?php
// used to find the extenstion of a filename
function findExtension ($filename) {
$filename = strtolower($filename) ;
$exts = split("[/\\.]", $filename) ;
$n = count($exts)-1;
$exts = $exts[$n];
return $exts;
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment