11 三 2009 @ 2:23 下午 

  arsort函数和array_slice函数的联合使用可以得到自己想要的数据,对于TOP10更新这样的程序处理是很有用处的

//note 得到前10名
   arsort($beautyUids);  //$beautyUids 为处理数据数组
   $beautyUids=array_slice($beautyUids,0,10,true);
   //note 更新前10的名次
   $i = 1;
   foreach($beautyUids as $feedKey=>$feed){
    updateTable(‘feed_logs’,array(‘feed_msg’=>$i),”toid=$feedKey and dateline > ‘$time8′”);
    $i++;
   }

Posted By: 大宇
Last Edit: 24 四 2009 @ 01:23 下午

EmailPermalinkComments (0)
Tags
Tags:
Categories: php, php函数, php技巧

 Last 50 Posts
Change Theme...
  • Users » 1
  • Posts/Pages » 165
  • Comments » 12
Change Theme...
  • VoidVoid « Default
  • LifeLife
  • EarthEarth
  • WindWind
  • WaterWater
  • FireFire
  • LightLight

关于



    No Child Pages.

Linux命令手册



    No Child Pages.

php.ini配置



    No Child Pages.

Memcache协议



    No Child Pages.