-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathphpFuncs2.php
More file actions
44 lines (39 loc) · 1.03 KB
/
phpFuncs2.php
File metadata and controls
44 lines (39 loc) · 1.03 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
<?php
/**
* Created by PhpStorm.
* User: Administrator
* Date: 2016/1/16
* Time: 19:34
*/
function read($dir, $fileList)
{
$handle = opendir($dir);
if ($handle) {
while (($file = readdir($handle)) !== false) {
if ($file != '.' && $file != '..') {
$cur_path = $dir . '/' . $file;
if (is_dir($cur_path)) {
// $filesArr1=read($cur_path, $fileList);
// for($i=0;$i<sizeof($filesArr1);$i++){
// array_push($fileList,$filesArr1[$i]);
// }
$fileList=read($cur_path, $fileList);
} else {
if(strstr($file,"3d")!== false){
array_push($fileList, $cur_path);
}
}
}
}
closedir($handle);
}
return $fileList;
}
function read_all_dir($dir)
{
$result = array();
$files = array();
$files=read($dir, $files);
$result['files'] = $files;
return $result;
}