$sort_file=array();
$filefj=array();
define('FILEPATH','../filehandle/uploadfile/');
$sortlist=trim($_GET["sort"]);
$dir=opendir(FILEPATH);
echo'鏂囦Huanjuanloulou紶Huanhangjiang adze?.FILEPATH.'
';
echo'鏂囦愿鍒楄〃锛?.'
';
if($sortlist == 'filetype'){
while (($file=readdir($dir))!== false) {
if ($file != "." && $file != "..") {
$file=basename($file);
$sort_file[]=$file;
}
}
foreach ($sort_file as $key=>$var) {
$filefj[]=explode('.',$var);
}
usort($filefj,'compare');
foreach ($filefj as $key=>$val){
$combinationfile=implode('.',$val);
echo '- '. $combinationfile.'
';
}else{
while (($file=readdir($dir))!== false) {
if ($file != "." && $file != "..") {
$file=basename($file);
echo '- '.$file.$file_size.'
';
}
}
}
echo '
';
closedir($dir);
echo'';
echo'
>游夋宁莞洵揂帓搴?lt;/a> 缁х画涓娄崶鏂囦浩 ';
function compare($x,$y){
If($x[1]==$y[1])
Return 0;
else if ($x[1]<$y[1])
Return -1;
else return 1;
}
?>
鏂囦happy 鏁徟灉灏changes into a 笉笇璇紴涓€haobian煡阆洆曰.
http://www.bkjia.com/PHPjc/632022.html
www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/632022.htmlTechArticle!DOCTYPE html PUBLIC -//W3C//DTD XHTML 1.0 Transitional//EN http://www.w3 .org/TR/xhtml1/DTD/xhtml1-transitional.dtd html xmlns=http://www.w3.org/1999/xhtml head meta http-equiv=Con...
Statement:The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn