例子 1. usort() 例子<?php
function cmp ($a, $b) {
    if ($a == $b) return 0;
    return ($a < $b) ? -1 : 1;
}$a = array (3, 2, 5, 6, 1);usort ($a, "cmp");while (list ($key, $value) = each ($a)) {
    echo "$key: $value\n";
}
?>  本例将显示: 0: 1
1: 2
2: 3
3: 5
4: 6
 

解决方案 »

  1.   

    你是说排列数组还是什么?http://www.php.net/manual/zh/function.sort.php
      

  2.   

    不知道你要干什么,不过
    <?
    $a = array (3, 2, 5, 6, 1);
    echo max($a); // out 6
    ?>
      

  3.   

    select * from tables order by counts DESC
      

  4.   

    max……还是 PHP 3 就有……吐血……
      

  5.   

    select top 1  from table order 某一列,desc
      

  6.   

    郁闷你不是说你会在mysql下用max函数?????难道这样不能解决问题?
      

  7.   

    select top 1  from table order 某一列,desc
    同意!!!