home *** CD-ROM | disk | FTP | other *** search
/ Enter 2004 June / ENTER.ISO / files / xampp-win32-1.4.5-installer.exe / xampp / example_dir.php < prev    next >
Encoding:
PHP Script  |  2004-03-24  |  651 b   |  24 lines

  1. <?PHP
  2.     require_once 'Stream/Var.php';
  3.     stream_wrapper_register( "var", "Stream_Var" );
  4.  
  5.     $dirname = 'var://_SERVER';
  6.     $dir = opendir($dirname);
  7.     echo    "<strong>opening directory '$dirname'</strong><br><br>";
  8.  
  9.     while ($entry = readdir($dir)) {
  10.         echo "opening file $dirname/$entry<br>";
  11.         if (!$fp = @fopen($dirname."/".$entry,"r")) {
  12.             echo "seems to be a directory<br><br>";
  13.             continue;
  14.         }
  15.            
  16.         echo "reading from $entry<br>";
  17.         while (!feof($fp)) {
  18.             echo fread($fp, 16);
  19.         }
  20.         fclose($fp);
  21.         echo    "<br><br>";
  22.     }
  23.     closedir($dir);
  24. ?>