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++;
}

Categories
Tag Cloud
Blog RSS
Comments RSS
Last 50 Posts
Back
Void « Default
Life
Earth
Wind
Water
Fire
Light 