插件24:目录列表
来源:互联网 发布:黑客帝国矩阵革命下载 编辑:程序博客网 时间:2024/04/30 14:37
<?php // Plug-in 24: Directory List// This is an executable example with additional code supplied// To obtain just the plug-ins please click on the Download link$directory = "c:\windows\\";$result = PIPHP_DirectoryList($directory);echo "<b>Listing:</b> $directory<br /><br />";if ($result[0] == 0) echo "No Directories";else{ echo "<b>Directories:</b> "; for ($j=0 ; $j < $result[0] ; ++$j) echo $result[2][$j] . ", ";}echo "<br /><br />";if ($result[1] == 0) echo "No files";else{ echo "<b>Files:</b> "; for ($j=0 ; $j < $result[1] ; ++$j) echo $result[3][$j] . ", ";}function PIPHP_DirectoryList($path){ // Plug-in 24: Directory List // // This plug-in accepts a path to a directory on the hard // disk and returns the list of files located there. The // function returns an array with the first element set // to the number of subdirectories in the directory and the // second to the number of files. If none are found then // 0 is returned. The third and fourth elements returned // contain arrays with all the directories and file names // respectively. The argument required is: // // $path: The directory to list $files = array(); $dirs = array(); $fnum = $dnum = 0; if (is_dir($path)) { $dh = opendir($path); do { $item = readdir($dh); if ($item !== FALSE && $item != "." && $item != "..") { if (is_dir("$path/$item")) $dirs[$dnum++] = $item; else $files[$fnum++] = $item; } } while($item !== FALSE); closedir($dh); } return array($dnum, $fnum, $dirs, $files);}?>
插件说明:
本插件接受服务器某个目录的位置,以数组的形式返回这个目录的全部文件。如果操作成功,则返回一个四元素的数组。其中第一个元素是找到的目录个数;第二个元素是找到的文件个数;第三个元素是一个数组,用于保存找到的目录名;第四个元素也是一个数组,用于保存找到的全部文件名。如果操作失败则返回一个只有一个元素的数组,元素的值为FALSE。
他需要参数:$path:服务器某个目录的路径。
- 插件24:目录列表
- eclipse 插件列表目录
- Jquery插件编写,关于实现左侧目录列表关闭开启
- 目录列表
- 插件列表
- 插件列表
- 读取目录列表
- 目录列表自动生成
- tomcat目录列表功能
- 目录列表的显示
- 目录列表器
- Apache禁止目录列表
- appscan漏洞--目录列表
- 博客目录列表
- 数字图像处理目录列表
- html创建目录列表
- 插件列表精选
- eclipse基本插件列表
- 用C++与OpenCV实现人人上的好友拼图应用
- hdu acm steps 2.2.6
- WPS
- linux 的inode
- Wamp2.1 安装到 D:wamp 系统图标 icons 无法显示的解决方法
- 插件24:目录列表
- 【郭林专刊】多线程知识总结线程通信,wait()与notify()的运用
- HTML5学习笔记
- 实现DropDownList 无刷新的联动效果
- 一道有趣的面试题——将int型数组强制转换为char*,再求strlen,涉及大小端
- strncpy
- Java相对路径/绝对路径总结
- loadrunner 在win2003下无法启动浏览器的问题
- 裸板烧写Uboot