Home > Backend Development > PHP Tutorial > A function to get the file extension (but the function name is called FILETYPE! Haha!)_PHP Tutorial

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

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
Release: 2016-07-13 11:00:20
Original
1047 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...
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
Latest Issues
Why does it still jump after returning false?
From 1970-01-01 08:00:00
0
0
0
Optimize table indexes in MySQL
From 1970-01-01 08:00:00
0
0
0
Why can't I install it?
From 1970-01-01 08:00:00
0
0
0
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template