PHP头条
热点:

一个目录遍历函数



一个目录遍历函数 <?php

function dirtree($path="./test") {
  echo "<dl>";
  $d = dir($path);
  while(false !== ($v = $d->read())) {
    if($v == "."
$v == "..")
      continue;
    $file = $d->path."/".$v;
    echo "<dt>$v";
    if(is_dir($file))
      dirtree($file);
  }
  $d->close();
  echo "</dl>";
}

dirtree();
?>

www.phpzy.comtrue/php/4041.htmlTechArticle一个目录遍历函数 一个目录遍历函数?php function dirtree($path="./test") { echo "dl"; $d = dir($path); while(false !== ($v = $d-read())) { if($v == "." $v == "..") continue; $file = $d-path."/".$v; echo "dt$v"; if(is_dir($file...

相关文章

相关频道:

PHP之友评论

今天推荐