list=array(); $__regexp=preg_quote($__pattern,"/"); $__regexp=preg_replace("/[\\x5C][\x2A]/",".*",$__regexp); $__regexp=preg_replace("/[\\x5C][\x3F]/",".", $__regexp); if(is_dir($__dir)) if(($__dir_h=@opendir($__dir))!==FALSE) { while(($__file=readdir($__dir_h))!==FALSE) if(preg_match("/^".$__regexp."$/",$__file)) array_push($this->list,$__file); closedir($__dir_h); sort($this->list,SORT_STRING); } } function toArray() { return $this->list; } function getLast() { return $this->list[count($this->list)-1]; } }