PHP closedir() Function

The closedir() function closes a directory handle.Closes the directory stream indicated by dir_handle. The stream must have previously been opened by opendir().

Example -

Parameters

dir_handle ⇩

The directory handle resource previously opened with opendir(). If the directory handle is not specified, the last link opened by opendir() is assumed.