Class document{
Private $file _array=array ();
Private $folder _array=array ();
Private $all _array=array ();
function Search ($path, $file) {
if (Is_dir ($path)) {
$H =opendir ($path);
while (false!== ($_file=readdir ($H))) {
if (Is_dir ($path. " /". $_file) &&$_file!=". "&& $_file!=": "&& $_file!==" Thumbs.db ") {
if (eregi ($file, $path. " /". $_file)) {
Array_push ($this->folder_array, $path. " /". $_file);
}
$this->search ($path. " /". $_file, $file);
}elseif (Is_file ($path. " /". $_file) &&$_file!=". "&& $_file!=": "&& $_file!==" Thumbs.db ") {
if (eregi ($file, $_file)) {
Array_push ($this->file_array, $path. " /". $_file);
}
}
}
$this->all_array["folder"]= $this->folder_array;
$this->all_array["File"]= $this->file_array;
return $this->all_array;
Closedir ($H);
}elseif (Is_file ($path)) {
if (eregi ($file, $path)) {
$this->all_array["file"]= $path;
}
return $this->all_array;
}else{
return $this->error ("This folder does not exits,please check it out.");
}
}
}
?>
< p="">
http://www.bkjia.com/PHPjc/486238.html www.bkjia.com true http://www.bkjia.com/PHPjc/486238.html techarticle PHP class Document {private $file _array =array (); private $folder _array =array (); private $all _array =array (); funct Ion Search ($path, $file) {if (Is_dir ($path)) {$H = open ...