Jump to: navigation, search

Php closedir

From w3cyberlearnings

PHP function closedir

This function closes a directory handle.

Syntax closedir

dir is a directory handle.

closedir(dir);

Example 1

<?php 
  $path = dirname(__FILE__).'/mydir';
  $dh = opendir($path);
  while(($d = readdir($dh)) !== false) {
     $pfile = $path. '/'. $d;

     echo "name: $d : type: ". filetype($pfile)."\n";
  }
  closedir($dh);
?>

--chdir-- chroot-- closedir-- dir-- getcwd-- opendir-- readdir-- rewinddir-- scandir--

Navigation
Web
SQL
MISC
References