function customSort($arr){
if (count($arr) < 2){
return $arr;
}else{
$min = $arr[0];
$small = [];
$big = [];
foreach($arr as $k=>$value){
if ($k=0){
continue;
}
if ($value>$min){
$big[] = $value;
}
if ($value<$min){
$small[] = $value;
}
}
}
return array_merge(customSort($small),[$min],customSort($big));
}
本作品採用《CC 協議》,轉載必須註明作者和本文連結