Created
July 25, 2012 21:20
-
-
Save tmbritton/3178741 to your computer and use it in GitHub Desktop.
Get File Extension
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function getExtension($filename){ | |
if($array = explode('.', $filename)){ | |
$last = count($array) -1; | |
$ext = strtolower($array[$last]); | |
return $ext; | |
} else { | |
return FALSE; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment