Searching Files in directory
Following code print all the file names in the files directory
$directory = 'files';
$files = glob("$directory/{*.*}",GLOB_BRACE);
print_r($files);
In the following line
$files = glob(”$directory/{*.*}”,GLOB_BRACE);
if we specify {*.txt} instead of {*.*}, then glob will return
only the txt files, and also we can specify the multiple file formats like {*.txt,*.doc}
