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

PHP中文网
Release: 2016-06-23 13:41:46
Original
800 people have browsed it

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


解决方案

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

z/xl-10.php  



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 Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!