php教程|php手册
PHP,文件,后缀名
php教程-php手册
网站1次解析源码,ubuntu重复登录情况,直接上传文件到tomcat,沈阳爬虫培训,php教程初学入门教程,潍坊seo方案lzw
这篇文章主要介绍了PHP实现获取文件后缀名的几种常用方法,通过三种不同的方法实例分析了php获取文件后缀名的实现技巧,分别通过字符串、文件属性及数组等方式实现
微分购源码,vscode运行es6报错,ubuntu调整语言,.tomcat8安装,爬虫简易教程,php类的静态方法的区别,仙桃茶叶seo推广都有哪些渠道lzw
公司网页源码,Ubuntu默认光标形状,爬虫反屏蔽策略,php 正则.,江苏seo电话lzw
本文实例讲述了PHP实现获取文件后缀名的几种常用方法。分享给大家供大家参考。具体如下:
方法1:
function get_file_type($filename){
$type = substr($filename, strrpos($filename, “.”)+1);
return $type;
}
方法2:
function get_file_type($filename)
{
$type = pathinfo($filename);
$type = strtolower($type[“extension”]);
return $type;
}
方法3:
function get_file_type($filename)
{
$type =explode(“.” , $filename);
$count=count($type)-1;
return $type[$count];
}
,