|
@ -22,7 +22,7 @@ class FileManager |
|
|
* @return int |
|
|
* @return int |
|
|
* 查看$extension数组中是否存在文件类型,不存在则返回-1 |
|
|
* 查看$extension数组中是否存在文件类型,不存在则返回-1 |
|
|
*/ |
|
|
*/ |
|
|
public function searchKey($array,$value, $key=-1){ |
|
|
|
|
|
|
|
|
public function searchType($array,$value, $key=-1){ |
|
|
foreach($array as $k=>$row){ |
|
|
foreach($array as $k=>$row){ |
|
|
if(!is_array($row)){ |
|
|
if(!is_array($row)){ |
|
|
if($row == $value){ |
|
|
if($row == $value){ |
|
@ -33,7 +33,7 @@ class FileManager |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
}else{ |
|
|
}else{ |
|
|
$r = self::searchKey($row,$value, $k); |
|
|
|
|
|
|
|
|
$r = self::searchType($row,$value, $k); |
|
|
if($r != -1){ |
|
|
if($r != -1){ |
|
|
return $r; |
|
|
return $r; |
|
|
} |
|
|
} |
|
|