HTML tutorial
CSS3 tutorial
Bootstrap tutorial
JavaScript tutorial
JQuery tutorial
AngularJS tutorial
React tutorial
NodeJS tutorial
PHP tutorial
Python tutorial
Python3 tutorial
Django tutorial
Linux tutorial
Docker tutorial
Ruby tutorial
Java tutorial
C tutorial
C ++ tutorial
Perl tutorial
JSP tutorial
Lua tutorial
Scala tutorial
Go tutorial
ASP.NET tutorial
C # tutorial
PHP Directory Reference : List files and directories inside the images directory
The scandir() function returns an array of files and directories of the specified directory.
Parameter | Description |
---|---|
directory | Required. Specifies the directory to be scanned |
order | Optional. Specifies the sorting order. Default sort order is alphabetical in ascending order (0). Set to SCANDIR_SORT_DESCENDING or 1 to sort in alphabetical descending order, or SCANDIR_SORT_NONE to return the result unsorted |
context | Optional. Specifies the context of the directory handle. Context is a set of options that can modify the behavior of a stream |
Return Value: | An array of files and directories on success, FALSE on failure. Throws an E_WARNING if directory is not a directory |
---|---|
PHP Version: | 5.0+ |
PHP Changelog: | PHP 5.4: The order constants were added |
❮ PHP Directory Reference