Home > php教程 > php手册 > body text

php怎么得到文件的后缀名

WBOY
Release: 2016-06-21 09:06:21
Original
1305 people have browsed it

substr(strrchr(文件名,'.'),1);
-------------------------------------
STRRCHR得到最后出现。点起的字/
SUBSTR
substr("abcdef", 1, 3);  // 传回 "bcd"
字符截取。从1到三。

相关函数
strstr
传回字串中某字串开始处至结束的字串。
比如:“1。2。3。4”
STRTCHR得到是。4
STRSTR得到是。2。3。4
===================================
$available_type = explode(' ',trim($db_uploadfiletype));
$attach_ext = substr(strrchr($atc_attachment_name,'.'),1);
in_array($attach_ext,$available_type)



Related labels:
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 Recommendations
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template