Return to Snippet

Revision: 19305
at October 21, 2009 05:05 by stancox


Initial Code
<?php
if ($dir = @opendir(getcwd()))
   {
    while(($file = readdir($dir)) !== false)
         {
          if(is_dir($file)&&$file!=="."&&$file!=="..")  { $array[] =$file." (dir)"; }
          elseif(is_file($file))                        { $array[] =$file." (file)"; }
         }
  closedir($dir);
}
print_r($array);
?>

Initial URL


Initial Description
without scandir() function

Initial Title
Save  files names in array

Initial Tags
array, files

Initial Language
PHP