Is There A Way To glob() Only Files?
I finally found a solution : echo “Only files\n”; $files = array_filter(glob(“/*”), ‘is_file’); var_dump($files); But take care, array_filter will preserve numeric keys : use array_values if you need to reindex the array.