scandir
scandir — List files and directories inside the specified path.Description
scandir( string $directory,Returns an array of files and directories from the directory.
int $sorting_order = SCANDIR_SORT_ASCENDING,
?resource $context = null ): array|false
Parameters
directory
The directory name
sorting_order
By default, the sorted order is alphabetical in ascending order. If the optional sorting_order is set to SCANDIR_SORT_DESCENDING, then the sort order is alphabetical in descending order. If it is set to SCANDIR_SORT_NONE then the result is unsorted.
context
For a description of the context parameter, refer to the streams section of the manual. If it is specified, then the context is passed to the stream_opendir function.
Return Values
Returns an array of filenames on success, or false on failure. If directory is not a directory, then boolean false is returned, and an error of level E_WARNING is generated.More information about scandir on official PHP documentation site
scandir - Popular snippets
- PHP 8.0 / MySQL 5.7 scandir printf
last run:
2022-01-16 14:58:24
3
- PHP 8.1 / MySQL 5.7 scandir print_r
last run:
2022-10-08 09:14:18
2
- PHP 8.1 / MySQL 5.7 scandir print_r
last run:
2022-10-08 08:58:53
2
- PHP 8.1 / MySQL 5.7 scandir print_r
last run:
2022-10-08 09:14:10
2
- PHP 8.0 / MySQL 5.7 scandir is_dir printf
last run:
2022-01-16 15:05:53
2
- PHP 8.0 / MySQL 5.7 scandir printf
last run:
2022-01-16 15:06:00
2
- PHP 8.0 / MySQL 5.7 scandir is_dir printf
last run:
2022-01-16 15:06:07
2
- PHP 8.0 / MySQL 5.7 print_r scandir
last run:
2022-01-16 15:01:49
2
- PHP 8.0 / MySQL 5.7 printf scandir
last run:
2022-01-16 15:00:08
2
- PHP 8.0 / MySQL 5.7 scandir
last run:
2022-01-16 15:00:19
2
scandir - New snippets
-
PHP 8.2.13 / MySQL 5.7 scandir printf phpversion
added at:
2023-04-28 07:33:39
1
-
PHP 5.6 / MySQL 5.7 scandir
added at:
2023-03-09 07:08:43
1
-
PHP 8.1 / MySQL 5.7 scandir
added at:
2023-03-09 07:08:17
1
-
PHP 8.1 / MySQL 5.7 scandir print_r shell_exec
added at:
2022-12-02 19:37:14
1
-
PHP 8.1 / MySQL 5.7 scandir print_r
added at:
2022-12-02 19:29:00
1
-
PHP 8.1 / MySQL 5.7 scandir print_r
added at:
2022-12-02 19:28:53
1
-
PHP 7.4 / MySQL 5.7 scandir print_r
added at:
2022-10-23 18:05:39
1
-
PHP 5.6 / MySQL 5.7 scandir print_r
added at:
2022-10-23 18:05:31
1
-
PHP 8.1 / MySQL 5.7 scandir print_r
added at:
2022-10-23 18:05:28
1
-
PHP 8.1 / MySQL 5.7 scandir print_r
added at:
2022-10-08 08:59:20
2