get current file php code example
Example 1: php current file name
basename(__FILE__, '.php');
Example 2: php get latest file in directory
$files = scandir('data', SCANDIR_SORT_DESCENDING);
$newest_file = $files[0];
basename(__FILE__, '.php');
$files = scandir('data', SCANDIR_SORT_DESCENDING);
$newest_file = $files[0];