Home >Backend Development >PHP Tutorial >PHP检索某目录下文件名问题

PHP检索某目录下文件名问题

PHP中文网
PHP中文网Original
2016-06-23 13:41:46853browse

获取某目录下  
 
xl-1.php, xl-2.php  xl-3.php ....  
 
中 最大的  xl-最大的.php   那个文件名 的 最简易的方法是?


解决方案

$a = glob('z/xl-*.php');natcasesort($a);echo end($a);

z/xl-10.php  



Statement:
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