php 排序

for($i=1;$i<count($result);$i++)
        {
            $tmp = $result[$i]['PNL'];
            $tmp_ = $result[$i];
            $j=$i-1 ;
            for(;$j>=0;$j--){
                if($result[$j]['PNL']>$tmp){
 
                    $result[$j+1] = $result[$j] ;
                }else{
 
                    break;
                }
            }
            $result[$j+1]=$tmp_ ;
        }
原文地址:https://www.cnblogs.com/aliblogs/p/5493848.html