scandir

PHP 5, PHP 7, PHP 8
scandir - List files and directories inside the specified path
Manual
Code Examples

Example #1 A simple scandir example

Result: Array ( [0] => . [1] => .. [2] => bar.php [3] => foo.txt [4] => somedir ) Array ( [0] => somedir [1] => foo.txt [2] => bar.php [3] => .. [4] => . )
PHP Version:


Function scandir:

Directories Functions

Most used PHP functions