当前位置:系统之家 > 技术开发教程 > 详细页面

一个目录遍历函数

一个目录遍历函数

更新时间:2022-05-12 文章作者:未知 信息来源:网络 阅读次数:


一个目录遍历函数<?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();
?>

温馨提示:喜欢本站的话,请收藏一下本站!

本类教程下载

系统下载排行