php get latest file in directory
snippet in php

php get latest file in directory

user3649

$files = scandir('data', SCANDIR_SORT_DESCENDING);
$newest_file = $files[0];