(PHP 4, PHP 5, PHP 7, PHP 8)
closedir — 關(guān)閉目錄句柄
$dir_handle
= ?): void
關(guān)閉由 dir_handle
指定的目錄流。流必須之前被
opendir() 所打開(kāi)。
示例 #1 closedir() 例子
<?php
$dir = "/etc/php5/";
// Open a known directory, read directory into variable and then close
if (is_dir($dir)) {
if ($dh = opendir($dir)) {
$directory = readdir($dh);
closedir($dh);
}
}
?>