public function GetFriendScoreOrder(&$result,$uid)
{
$json_array = '{"1548940117":"157829","1584778420":"7842","1052833673":"442222"}';
$json2array = json_decode($json_array,TRUE);
print_r($json2array);
arsort($json2array);
print_r($json2array);
//var_dump($json2array);
$uids = array_flip($json2array);
$return = Person::getRealNames(&$resultname,$uids);
$i = 0;
foreach($resultname as $k =>$v)
{
$arraydisplay[$i][name] = $v;
$arraydisplay[$i][uid] = $k;
$arraydisplay[$i][score] = $json2array[$k];
$i++;
}
$result = $arraydisplay;
{
$json_array = '{"1548940117":"157829","1584778420":"7842","1052833673":"442222"}';
$json2array = json_decode($json_array,TRUE);
print_r($json2array);
arsort($json2array);
print_r($json2array);
//var_dump($json2array);
$uids = array_flip($json2array);
$return = Person::getRealNames(&$resultname,$uids);
$i = 0;
foreach($resultname as $k =>$v)
{
$arraydisplay[$i][name] = $v;
$arraydisplay[$i][uid] = $k;
$arraydisplay[$i][score] = $json2array[$k];
$i++;
}
$result = $arraydisplay;
膘叔(19129540) 15:42:02
usort
莫莫(3296320) 15:42:32
对
莫莫(3296320) 15:42:38
用usort很简单
膘叔(19129540) 15:44:59
usort直接有例子的。
作者:jackxiang@向东博客 专注WEB应用 构架之美 --- 构架之美,在于尽态极妍 | 应用之美,在于药到病除
地址:http://jackxiang.com/post/1701/
版权所有。转载时必须以链接形式注明作者和原始出处及本声明!
最后编辑: jackxiang 编辑于2009-4-8 16:02
评论列表