list_files
list_files ( $folder = '', $levels = 100, $exclusions = array(), $include_hidden = false )
Parameters:- (string) folder Optional. Full path to folder. Default empty.
- (int) levels Optional. Levels of folders to follow, Default 100 (PHP Loop limit).
- (string[]) exclusions Optional. List of folders and files to skip.
- (bool) include_hidden Optional. Whether to include details of hidden ("." prefixed) files. Default false.
Returns:- (string[]|false) Array of files on success, false on failure.
Defined at:Change Log: - Introduced in WordPress: 2.6.0
- Deprecated in WordPress: —
Description
Returns a listing of all files in the specified folder and all subdirectories up to 100 levels deep.The depth of the recursiveness can be controlled by the $levels param.