php gets all the file names in the directory
1. First open the directory to be operated and point a variable to it
//Open the subdirectory common under the directory pic in the current directory.
$handler = opendir('pic/common');
2. Loop to read all files in the directory
/* Among them, $filename = readdir($handler) is the file name assignment that will be read each time in the loop. Give $filename, in order not to get stuck in an infinite loop, so $filename !== false. Be sure to use !==, because if a file name is called '0', or something is considered false by the system, using != will stop the loop*/
while( ($filename = readdir($handler)) ) !== false )
{
3. There will be two files in the directory, named '.' and '..', do not operate them
if($filename != "." && $filename != ""