I know that glob can look for all files or only all directories inside a folder : But I didn’t found something to find only files in a single line efficiently. Works well but reads directory twice (even if there are some optimizations that make the second browsing quicker). Answer I finally found a solution : But take care, array_filter