I am using the following code to get a list of images in a directory:
$files = scandir($imagepath);
but $files also includes hidden files. How can I exclude them?
$files
On Unix, you can use preg_grep to filter out filenames that start with a dot:
preg_grep
$files = preg_grep('/^([^.])/', scandir($imagepath));
1.4m articles
1.4m replys
5 comments
57.0k users