时间:2021-07-01 10:21:17 帮助过:6人阅读
$a=array('11','2','13','4','22');
$num = count($a);
for($i=0;$i<$num;$i++){
for($j=0;$j<$num;$j++){
if($a[$i]<$a[$j]){
$temp = $a[$i];
$a[$i]=$a[$j];
$a[$j]=$temp;
}
}
}
print_r($a);
http://www.bkjia.com/PHPjc/323355.htmlwww.bkjia.comtruehttp://www.bkjia.com/PHPjc/323355.htmlTechArticle 代码如下:
$a=array('11','2','13','4','22'); $num = count($a); for($i=0;$i$num;$i++){ for($j=0;$j$num;$j++){ if($a[$i]$a[$j]){ $temp = $a[$i]; $a[$i]=$a[$j]; $a[$j]...