1.系统函数调用

点击(此处)折叠或打开

  1. <?php
  2. $dirname="./phpmyadmin";

  3. /*打开目录*/
  4. function fordir($dirname){

  5. $dir=opendir($dirname);
  6. echo readdir($dir),'<br>';
  7. echo readdir($dir),'<br>';
  8. while($file=readdir($dir)){
  9.     $file=$dirname."/".$file;
  10.     /*is_dir 判断是文件还是目录*/
  11.     if(is_dir($file))
  12.         echo "目录:$file<br>";
  13.     else
  14.         echo "文件: $file <br>";
  15. closedir($dir);}
  16. fordir($dirname)

10-05 04:01