Changeset 2646

Show
Ignore:
Timestamp:
05/06/2008 02:19:24 PM (5 months ago)
Author:
Shadowhand
Message:

Added file::extension($filename)

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/system/helpers/file.php

    r2374 r2646  
    1111 */ 
    1212class file_Core { 
     13 
     14        /** 
     15         * Get the extension of a filename. 
     16         * 
     17         * @param   string   filename 
     18         * @return  string 
     19         */ 
     20        public static function extension($filename) 
     21        { 
     22                // Return the extension of the filename 
     23                return preg_replace('/^.+\.(.+?)$/', '$1', $filename); 
     24        } 
    1325 
    1426        /**