Home > php教程 > php手册 > PHP获取文件拓展名的几种方式

PHP获取文件拓展名的几种方式

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
Release: 2016-06-06 19:57:13
Original
1431 people have browsed it

文件名: test.php 获取拓展名(php)的方法: 1.strrchr($filename, .); 2.substr($filename, strrpos($filename, .)) 3.array_pop(explode(., $filename)); 4.$p = pathinfo($filename); echo $p[extension]; 参考: 1.http://www.phpddt.com/php/761.html 2.

文件名: test.php

获取拓展名(php)的方法:


 1.strrchr($filename, '.');
 2.substr($filename, strrpos($filename, '.'))
 3.array_pop(explode('.', $filename));
 4.$p = pathinfo($filename);
   echo $p['extension'];
Copy after login

参考:

1. http://www.phpddt.com/php/761.html

2. http://www.phpddt.com/php/php-sina-test.html

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
Latest Issues
php data acquisition?
From 1970-01-01 08:00:00
0
0
0
PHP extension intl
From 1970-01-01 08:00:00
0
0
0
How to learn php well
From 1970-01-01 08:00:00
0
0
0
Popular Recommendations
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template