A function to get the file extension (but the function name is called FILETYPE! Haha!)_PHP Tutorial

WBOY
Release: 2016-07-13 11:00:20
Original
932 people have browsed it

/*
GetFileType
Usage: GetFiletype($filename)
*/
function GetFiletype($Filename) {
if (substr_count($Filename, "." ) == 0) { // Check whether there is a . number in the file name.
return; // Return empty
} else if (substr($Filename, -1) == ".") { Check if it ends with ., that is, no extension
return; // Return empty
} else {
$FileType = strrchr ($Filename, "."); // Cut
from . number $FileType = substr($FileType, 1); // Remove . number
          return $FileType;                                                                                                                                         / Print out php4
?>





http://www.bkjia.com/PHPjc/631814.html

www.bkjia.com

truehttp: //www.bkjia.com/PHPjc/631814.htmlTechArticle? /* GetFileType usage: GetFiletype($filename) */ function GetFiletype($Filename) { if (substr_count( $Filename, .) == 0) {// Check whether there is a . sign in the file name. return;// Return empty...
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!