码迷,mamicode.com
首页 >  
搜索关键字:opendir    ( 161个结果
PHP入门02 -- 系统函数
一、Directory函数 1、chdir:改变目录 2、chroot:改变根目录 3、dir:返回一个Directory 4、getcwd:取得当前工作目录 5、opendir:打开目录句柄 6、readdir:从目录句柄中读取条目 7、rewinddir:倒回目录句柄 8、scandir:列出指 ...
分类:Web程序   时间:2018-02-24 19:39:13    阅读次数:191
目录操作(C语言)
目录操作(C语言) 头文件: #include<unistd.h> #include<sys/stat.h> #include<dirent.h> 读取目录 需要的头文件:#include<dirent.h> 打开目录,在失败的时候返回一个空的指针。 DIR * opendir(const char ...
分类:编程语言   时间:2018-01-31 14:22:13    阅读次数:161
wampserver的localhost下点击项目,url不对
wampserver的localhost下点击项目,url不对 找到wamp 的www 目录下的index.php 文件打开后 找到399行这里 $handle=opendir("."); $projectContents = ''; while (($file = readdir($handle) ...
分类:Web程序   时间:2017-12-11 14:26:33    阅读次数:163
PHP递归遍历文件夹
functionget_files($dir){$files=array();if(!is_dir($dir)){return$files;}$handle=opendir($dir);if($handle){while(false!==($file=readdir($handle))){if($file!=‘.‘&&$file!=‘..‘){$filename=$dir."/".$file;if(is_file($filename)){$files[]=$filename;}else{$fi..
分类:Web程序   时间:2017-11-19 12:41:03    阅读次数:137
php递归删除目录及子文件文件夹
$path='./phpMyAdmin'; function delAll($path){ if(is_dir($path)){ $handle=opendir($path); //$file=readdir($handle); 为什么不能在外面读取目录句柄 while(false !== ($fi... ...
分类:Web程序   时间:2017-11-02 23:17:20    阅读次数:210
php递归遍历目录
$path='./phpMyAdmin'; function showAll($path){ if(is_dir($path)){ $handle=opendir($path); //$file=readdir($handle); 为什么不能在外面读取目录句柄 echo ""; while(f... ...
分类:Web程序   时间:2017-11-02 22:29:13    阅读次数:237
遍历一个文件夹下面所有的文件和子文件夹
<?php //遍历一个文件下的所有文件夹和子文件夹 $dir=‘../bootstrap-3.3.7-dist‘; functionshowdir($dir){ $arr=array(); if($hd=opendir($dir)){ while($file=readdir($hd)){ if($file!==‘..‘&&$file!==‘.‘){ if(is_dir($dir.‘/‘.$file)){ $arr[$file]=showdir($..
分类:其他好文   时间:2017-10-11 00:41:22    阅读次数:105
用glob()函数返回目录下的子文件以及子目录
glob() 函数返回匹配指定模式的文件名或目录 相对于readdir()和opendir()来说,使用glob()函数会方便很多 代码1: 运行结果: 代码2: 运行结果: 补充: print()函数和echo语句只能简单的输出字符串和数值,而无法输出数组信息 print_r()函数则可以用来输出 ...
分类:其他好文   时间:2017-09-13 20:17:05    阅读次数:176
php删除目录 删除文件保留目录
//循环删除目录和文件函数 删除目录及目录下所有文件 public static function delDirAndFile( $dirName ) { //var_dump(is_dir($dirName));exit; if ( $handle = opendir( "$dirName" ) ... ...
分类:Web程序   时间:2017-09-04 16:03:09    阅读次数:246
php 删除指定文件夹
php 删除指定文件夹 1、前言 目标:php删除一个指定目录 所使用的的php函数:is_dir,opendir,readdir,scandir,rmdir,closedir,等等(注:其他文件操作函数也可以完成,这里只列举了本次使用的函数) 2、相关函数介绍 php文件操作的方法大致相同,已经在 ...
分类:Web程序   时间:2017-07-25 00:49:40    阅读次数:297
161条   上一页 1 2 3 4 5 6 ... 17 下一页
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!