Get all of the directories within a given directory.
public static directories ( string $directory ) : array | ||
$directory | string | |
return | array |
$dir = opendir('/path/to/directory'); while($file = readdir($dir)){ echo $file . '
'; } closedir($dir);
mkdir('/path/to/new/directory', 0755);
rmdir('/path/to/directory');Some of the package libraries that PHP provides for working with file directories are `FilesystemIterator`, `DirectoryIterator`, and `GlobIterator`. These libraries provide additional functionality and options for working with file directories. For example, `FilesystemIterator` provides support for filtering files by name, file size, and file attributes.
public static directories ( string $directory ) : array | ||
$directory | string | |
return | array |