最新消息:文章中包含代码时,请遵守代码高亮规范!

PHP二维数组排序(转载)

PHP Alex 609浏览 0评论

 

$unread_notify = $this->redis->hvals('ushark:unread:notify:3');
foreach ($unread_notify as &$val) {
    $val = json_decode($val, true);
}
$time = array_column($unread_notify, 'newest_time');
array_multisort($time, SORT_DESC, $unread_notify);    !!! 关键 !!!
print_r($unread_notify);

 

转载时请注明出处及相应链接,本文永久地址:https://blog.yayuanzi.com/23075.html

发表我的评论
取消评论

表情