if($TMPVAR>$max)
{
   $max = $TMPVAR;
}else{
   $max = $max;
}

解决方案 »

  1.   

    $tmpvar > $max ? $tmpvar : $max;if()
    {}
    else
    {}
      

  2.   

    php不是有现成的函数么如果只是要最大/最小值,不需要全部排序,用冒泡法
      

  3.   

    $TMPVAR 是由数组取出的,值有10000笔例如下面这样max()能用吗?不行吧!?
    88.31
    88.33
    88.34
    88.36
    88.38
    88.4
    88.42
    88.43
    88.45
    88.47
    88.49
    88.51
    88.52
    88.54
    88.56
    88.58
    88.6
    88.61
    88.63
    88.65
    88.67
    88.69
    88.7
    88.72
    88.74
    88.76
    88.78
    88.79
    88.81
      

  4.   

    数组也一样的:
    $MyArray = array(88.31,88.33,88.34,88.36,88.38,88.4,88.42,88.43,88.45,88.47,88.49,88.51,88.52,88.54,88.56,88.58,88.6,88.61,88.63,88.65,88.67,88.69,88.7,88.72,88.74,88.76,88.78,88.79,88.81); 
    $MaxNumber = max($MyArray);若不是数组就可以直接这样:
    $MaxNumber = max(88.31,88.33,88.34,88.36,88.38,88.4,88.42,88.43,88.45,88.47,88.49,88.51,88.52,88.54,88.56,88.58,88.6,88.61,88.63,88.65,88.67,88.69,88.7,88.72,88.74,88.76,88.78,88.79,88.81);
      

  5.   

    to: weboscar(oscar)
    没试过以前不要说行不行
      

  6.   

    to: syre(神仙)
    我没有说肯定不行!! 我是加上疑问 “?” 问号!! 
    我的数组有[1][2]二组$newclass="./fopdata/".$class ;
    $ary=file($newclass);
       $min2=99999;
       $max2=0;foreach($ary as $tmp)  //例如 0.00, 29962.00 ………共有10000笔
        if(preg_match('/(.*),(.*)\.(.*)/',$tmp,$match))
        { 
      $min2=$match[2]<$min2?$match[2]:$min2; //最小值
          $max2=$match[2]>$max2?$match[2]:$max2; //最大值
    }