2017年7月16日

php上传文件类

摘要: _error; } public function __construct() { $this->_max_size = 1024*1024; $this->_type_map = array( '.png' => array('image/png', 'image/x-png'), '.j... 阅读全文

posted @ 2017-07-16 17:52 huodaihao 阅读(131) 评论(0) 推荐(0) 编辑

编码问题

摘要: var_dump(file_exists(iconv('UTF-8', 'GBK', './中文文件名.txt')));//代码中 路径中存在中文,编码的转换 $fileinfo['name'] = iconv('gbk', 'utf-8', $file);//目录文件名编码问题:展示时,将操作系统编码转换为响应数据编码。 // Windows gbk,项目utf-8,将... 阅读全文

posted @ 2017-07-16 17:16 huodaihao 阅读(66) 评论(0) 推荐(0) 编辑

php目录递归删除

摘要: <?php // $call_num = 0; $path = 'e:/test/'; $result = rmDirs($path, $n); var_dump($result); var_dump($n); /** * @param 目录地址 */ function rmDirs($path, &$call) { ++ $call; // ++ $GLOBALS['ca... 阅读全文

posted @ 2017-07-16 16:59 huodaihao 阅读(146) 评论(0) 推荐(0) 编辑

php嵌套数据

摘要: '; print_r($list); /** * @param 目录地址 */ function readDirsNested($path) { $nested = array();//存储当前目录下所有的文件 $dir_handle = openDir($path); while(false !== $file=readDir($dir_handle)) { ... 阅读全文

posted @ 2017-07-16 16:46 huodaihao 阅读(137) 评论(0) 推荐(0) 编辑

php 递归遍历目录带缩进

摘要: '; //判断当前是否为目录 if(is_dir($path . '/' . $file)) { //是目录 $func_name = __FUNCTION__; $func_name($path . '/' . $file, 1+$deep); } } cl... 阅读全文

posted @ 2017-07-16 10:20 huodaihao 阅读(246) 评论(0) 推荐(0) 编辑

php 递归遍历目录

摘要: '; //判断当前是否为目录 if(is_dir($path . '/' . $file)) { //是目录 readDirs($path . '/' . $file); } } closeDir($dir_handle); } // $path = './'; // readDirs($path); 阅读全文

posted @ 2017-07-16 10:17 huodaihao 阅读(3744) 评论(0) 推荐(0) 编辑

导航