/** 二为数组的排序 **/ $ids = array(); foreach ($message_result as $user) { $ids[] = $user['msg_time']; } array_multisort($ids, SORT_DESC, $message_result);