Return to Snippet

Revision: 2987
at May 21, 2007 20:15 by IanLewis


Initial Code
//gets a filenames extension
function filename_extension($filename) {//{{{
   $pos = strrpos($filename, '.');
   if($pos===false) {
       return false;
   } else {
       return substr($filename, $pos+1);
   }
}//}}}

Initial URL

                                

Initial Description
Gets a filename's extention.

Initial Title
Get a filename extension

Initial Tags

                                

Initial Language
PHP