PHP: Last file in directory

file, php

Solution

Using the Directories extension you can do it simply with

$all_files = scandir("/my/path",1);
$last_files = $all_files[0];

Problem

How do I get the name of the last file (alphabetically) in a directory with php? Thanks.

Original source