Created
May 5, 2015 04:17
-
-
Save GoldenEra/65bf1c93b9f011590cc1 to your computer and use it in GitHub Desktop.
php: get suffix from a given file name
This file contains 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
/** | |
* get suffix from a given file_name | |
* | |
* @since [1.0] | |
* @see [filetype()] | |
* @author Richard | |
* @date 2015-05-05 | |
* | |
* @param [string] $file_name [a.txt] | |
* @return [sring] [txt] | |
*/ | |
function file_suffix($file_name) | |
{ | |
return substr($file_name, strrpos($file_name, '.') - strlen($file_name) + 1); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment