forked from payonesmile/yzm_decode
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfile.class.php
More file actions
37 lines (33 loc) · 823 Bytes
/
file.class.php
File metadata and controls
37 lines (33 loc) · 823 Bytes
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
<?php
class File {
/**
* 获取文件夹下的文件名
* @param string $dir
* @return array 文件名数组
*/
public static function getFileName($dir) {
if ($dir == NULL) {
$dir = "./";
}
$fopen = opendir($dir);
$FileArray = array();
while ($File = readdir($fopen)) {
if ($File != '.' && $File != '..' && strpos($File, '.')) {
$index = substr_replace($File, '', -4);
$FileArray[] = $index;
}
}
return $FileArray;
}
/**
* 返回数组中的最大值
* @param array $array
* @return boolean
*/
public static function max($array) {
if (is_array($array)) {
return max($array);
}
return false;
}
}