PHP:目录中的最后一个文件

use*_*est 3 php file

如何在php目录中获取最后一个文件的名称(按字母顺序排列)?谢谢.

Vin*_*vic 8

使用目录扩展,您可以使用

$all_files = scandir("/my/path",1);
$last_files = $all_files[0];
Run Code Online (Sandbox Code Playgroud)

  • @ cb160:混合德语,日语和韩语时,"按字母顺序"是什么意思? (3认同)