一个目录遍历函数

2016-02-19 11:35 3 1 收藏

今天图老师小编要跟大家分享一个目录遍历函数,精心挑选的过程简单易学,喜欢的朋友一起来学习吧!

【 tulaoshi.com - Web开发 】


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

来源:https://www.tulaoshi.com/n/20160219/1597942.html

延伸阅读
标签: Web开发
?xml version="1.0" encoding="ISO-8859-1"?!-- Edited with XML Spy v4.2 --breakfast_menu food nameBelgian Waffles/name price$5.95/price descriptiontwo of our famous Belgian Waffles with plenty of real maple syrup/description calories650/calories /food food nameStrawberry Belgian...
标签: PHP
  前面见到有人发表 但是速度比较慢,也非常长 这里给出一种 function ubb($str) {   $color=Array('red','blue','green'); $str=eregi_replace('\[url\]([a-zA-Z0-9@:%_.~#-\?&]+)\[\/url\]','<a href=http://\\1\\1</a',$str);//url $str=eregi_replace('\[url=http://([a-zA-Z0-9@:%_.~#-\?&]+)\](.+)...
标签: Web开发
select id="Year" name="Year"option value=""/option/select年 select id="Month" name="Month"/select月 select id="Day" name="Day"/select日br / select id="iYear" name="iYear"option value=""/option/select年 select id="iMonth" name="iMonth"/select月select id...
标签: PHP
我的目标是去掉字符串中的空格,句号和逗号。 $str="hello baby,nice to meet you.hehe";//这样可以正确显示 $str="hello baby,nice to meet you . hehe";//如果在句号前面或后面多了个空格就会出现数组里某个键的值为空,也就是说当需要去掉的字符一起出现时,就会出现空值,这是为何,该如何解决? //我的一个方法是判断值是否...
因查询统计需要,今天早上在SQLSERVER里写了一个类似于Split的函数,如下 create function f_split(@SourceSql varchar(8000),@StrSeprate varchar(10)) returns @temp table(a varchar(100)) --实现split功能 的函数 --date    :2005-4-20 --Author :Domino as begin     declare @i int   &nb...

经验教程

947

收藏

42
微博分享 QQ分享 QQ空间 手机页面 收藏网站 回到头部