0) { foreach(array_keys($array) as $key) $temp[$key]=$array[$key][$index]; if(!$natsort) ($order=='asc')? asort($temp) : arsort($temp); else { ($case_sensitive)? natsort($temp) : natcasesort($temp); if($order!='asc') $temp=array_reverse($temp,TRUE); } foreach(array_keys($temp) as $key) (is_numeric($key))? $sorted[]=$array[$key] : $sorted[$key]=$array[$key]; return $sorted; } return $array; } function displayFileList ($directory) { global $root; $handler = opendir($directory); $i=0; $files = array(); $filepaths = array(); while ($file = readdir($handler)) { if(is_dir($directory . $file)) $dirs[] = array('isdir'=> 1, 'filename'=>$file, 'lcname' => strtolower($file)); else $files[] = array('isdir'=> 0, 'filename'=>$file, 'lcname' => strtolower($file)); } closedir($handler); $dirs = sort2d($dirs, 'lcname', 'asc'); $files = sort2d($files, 'lcname', 'asc'); $files = array_merge($dirs, $files); foreach ($files as $node) { $file = $node['filename']; $isdir = $node['isdir']; if ($file != '.' && $file != '..' && substr($file, 0, 1) != '.') { $filename = $file; $path = $directory . $file; if($isdir && substr($path, -1) != '/') $path .= '/'; // $filetype = mime_content_type($path); $filesize = formatBytes(filesize($path)); $filedate = date("j, n, Y", filectime($path)); $filepaths[] = $path; if($i == 0) { ?> 0) { ?>
[x] name size date type
There are no files in this directory.