You can use the PHP function scandir() to get all files and directories present inside a directory.
Here is an example
<?php$dir = "path_to_your_directory/";print_r(scandir($dir));?>
<?php
$dir = "path_to_your_directory/";
print_r(scandir($dir));
?>