phpday 2027 - Call for Papers

closedir

(PHP 4, PHP 5, PHP 7, PHP 8)

closedir — Close directory handle

Опис

function closedir(?resource $dir_handle = null): void

Closes the directory stream indicated by dir_handle.

Параметри

dir_handle

A directory handle resource previously opened with opendir(). If dir_handle is null the last handle opened using opendir() will be used.

Значення, що повертаються

Не повертає значень.

Журнал змін

Версія Опис
8.5.0 Using null for dir_handle is now deprecated. Instead, the last opened directory handle should be explicitly provided.
8.0.0 dir_handle is now nullable.

Приклади

For a complete example refer to the opendir() documentation.

Прогляньте також

  • opendir() - Open directory handle
  • readdir() - Read entry from directory handle
  • rewinddir() - Rewind directory handle
  • dir() - Return an instance of the Directory class
  • is_dir() - Tells whether the filename is a directory
  • glob() - Find pathnames matching a pattern
  • scandir() - List files and directories inside the specified path

User Contributed Notes

There are no user contributed notes for this page.
Adding new notes is disabled. Please see the links in the Found A Problem? section.
To Top