Definition :
In php readdir() Function is inbuilt function.The readdir() function which is used to return the name of the next entry in a directory. The method returns the filenames in the order as they are stored in the filenamesystem.
readdir(dir)
Parameter | Description |
---|---|
dir | Optional. Specifies the directory handle resource previously opened with opendir(). If this parameter is not specified, the last link opened by opendir() is assumed |
Given below example illustrate the readdir() function:
Output :
File Name: gfg.jpg
File Name: ..
File Name: article.pdf
File Name: .
File Name: article.txt