时间:2021-07-01 10:21:17 帮助过:22人阅读
|
用php代码实现一个目录导航的功能,将指定目录中指定扩展名的文件加上超链接,很实用的功能,有需要的朋友,可以参考下。
以下代码实现: 把指定的目录里中指定扩展名的文件加上超连接,也可以忽略某些指定的文件不作导航。
read()) {
//ignor all files not of htm type.
if (strpos($current, "php")!= FALSE) //设定PHP文件被导航
//忽略自己(如 index.html)
{ if (strpos($current, "ndex") == FALSE)
{
print "";
print $current;
print "";
print $pipe;
};
};
};
};
//调用函数
navbar()
?> |