closedir 함수
(PHP 4, PHP 5, PHP 7, PHP 8)
Closedir - 디렉토리 핸들 닫기
설명
closedir(?resource $dir_handle
= null
): void
dir_handle
로 표시된 디렉토리 스트림을 닫습니다. 스트림은 이전에 opendir()에 의해 열려 있어야 합니다.
매개변수
반환 값
값이 반환되지 않습니다.
Examples
예제 #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);
}
}
?>