我一直在努力尝试通过“user_likes”和“created_time”在 PHP 中对这个数组进行排序。我在 Stackoverflow 上查看了一些示例,但无法找出正确的语法。我希望订单从最多的“user_likes”开始,然后是“created_time”,不确定它是否可能。我一直在尝试使用 array_multisort,但没有成功。
Array
(
[0] => Array
(
[taskuser] => Array
(
[profilepic] => 1e605ad76c82d41f6467c2525f796ebd.jpg
[postid] => 598
[message] => sweet!
[created_time] => 2012-04-23 13:53:58
)
[time_created] => 3d
[likes] => Array
(
[like_type] => 0
)
[comments] => Array
(
[comments] => 0
)
[user_likes] => Array
(
[user_likes] => 0
)
[user_comments] => Array
(
[user_comments] => 0
)
[user_favorite] => Array
(
[isFav] => 0
)
)
[1] => Array
(
[taskuser] => Array
(
[profilepic] => 1e605ad76c82d41f6467c2525f796ebd.jpg
[postid] => 598
[message] => sweet!
[created_time] => 2012-04-23 14:05:20
)
[time_created] => 3d
[likes] => Array
(
[like_type] => 0
)
[comments] => Array
(
[comments] => 0
)
[user_likes] => Array
(
[user_likes] => 0
)
[user_comments] => Array
(
[user_comments] => 0
)
[user_favorite] => Array
(
[isFav] => 0
)
)
[2] => Array
(
[taskuser] => Array
(
[profilepic] => 1e605ad76c82d41f6467c2525f796ebd.jpg
[postid] => 598
[message] => sweet!
[created_time] => 2012-04-23 14:09:11
)
[time_created] => 3d
[likes] => Array
(
[like_type] => 0
)
[comments] => Array
(
[comments] => 0
)
[user_likes] => Array
(
[user_likes] => 0
)
[user_comments] => Array
(
[user_comments] => 0
)
[user_favorite] => Array
(
[isFav] => 0
)
)
[3] => Array
(
[taskuser] => Array
(
[profilepic] => 1e605ad76c82d41f6467c2525f796ebd.jpg
[postid] => 598
[message] => sweet!
[created_time] => 2012-04-23 14:11:35
)
[time_created] => 3d
[likes] => Array
(
[like_type] => 0
)
[comments] => Array
(
[comments] => 0
)
[user_likes] => Array
(
[user_likes] => 0
)
[user_comments] => Array
(
[user_comments] => 0
)
[user_favorite] => Array
(
[isFav] => 0
)
)
[4] => Array
(
[taskuser] => Array
(
[profilepic] => 1e605ad76c82d41f6467c2525f796ebd.jpg
[postid] => 598
[message] => sweet!
[created_time] => 2012-05-25 11:22:17
)
[time_created] => 3d
[likes] => Array
(
[like_type] => 3
)
[comments] => Array
(
[comments] => 1
)
[user_likes] => Array
(
[user_likes] => 0
)
[user_comments] => Array
(
[user_comments] => 0
)
[user_favorite] => Array
(
[isFav] => 0
)
)
[5] => Array
(
[taskuser] => Array
(
[profilepic] => 1e605ad76c82d41f6467c2525f796ebd.jpg
[postid] => 598
[message] => sweet!
[created_time] => 2012-04-17 15:56:00
)
[time_created] => 3d
[likes] => Array
(
[like_type] => 0
)
[comments] => Array
(
[comments] => 0
)
[user_likes] => Array
(
[user_likes] => 0
)
[user_comments] => Array
(
[user_comments] => 0
)
[user_favorite] => Array
(
[isFav] => 0
)
)
[6] => Array
(
[taskuser] => Array
(
[profilepic] => 1e605ad76c82d41f6467c2525f796ebd.jpg
[postid] => 598
[message] => sweet!
[created_time] => 2012-04-17 15:58:03
)
[time_created] => 3d
[likes] => Array
(
[like_type] => 0
)
[comments] => Array
(
[comments] => 0
)
[user_likes] => Array
(
[user_likes] => 0
)
[user_comments] => Array
(
[user_comments] => 0
)
[user_favorite] => Array
(
[isFav] => 0
)
)
[7] => Array
(
[taskuser] => Array
(
[profilepic] => 1e605ad76c82d41f6467c2525f796ebd.jpg
[postid] => 598
[message] => sweet!
[created_time] => 2012-04-20 16:24:53
)
[time_created] => 3d
[likes] => Array
(
[like_type] => 0
)
[comments] => Array
(
[comments] => 0
)
[user_likes] => Array
(
[user_likes] => 0
)
[user_comments] => Array
(
[user_comments] => 0
)
[user_favorite] => Array
(
[isFav] => 0
)
)
[8] => Array
(
[taskuser] => Array
(
[profilepic] => 1e605ad76c82d41f6467c2525f796ebd.jpg
[postid] => 598
[message] => sweet!
[created_time] => 2012-05-11 15:56:55
)
[time_created] => 3d
[likes] => Array
(
[like_type] => 1
)
[comments] => Array
(
[comments] => 0
)
[user_likes] => Array
(
[user_likes] => 0
)
[user_comments] => Array
(
[user_comments] => 0
)
[user_favorite] => Array
(
[isFav] => 0
)
)
[9] => Array
(
[taskuser] => Array
(
[profilepic] => 1e605ad76c82d41f6467c2525f796ebd.jpg
[postid] => 598
[message] => sweet!
[created_time] => 2012-05-11 16:05:35
)
[time_created] => 3d
[likes] => Array
(
[like_type] => 1
)
[comments] => Array
(
[comments] => 4
)
[user_likes] => Array
(
[user_likes] => 0
)
[user_comments] => Array
(
[user_comments] => 0
)
[user_favorite] => Array
(
[isFav] => 0
)
)
[10] => Array
(
[taskuser] => Array
(
[profilepic] => 1e605ad76c82d41f6467c2525f796ebd.jpg
[postid] => 598
[message] => sweet!
[created_time] => 2012-05-30 21:04:00
)
[time_created] => 3d
[likes] => Array
(
[like_type] => 0
)
[comments] => Array
(
[comments] => 0
)
[user_likes] => Array
(
[user_likes] => 0
)
[user_comments] => Array
(
[user_comments] => 0
)
[user_favorite] => Array
(
[isFav] => 0
)
)
[11] => Array
(
[taskuser] => Array
(
[profilepic] => 1e605ad76c82d41f6467c2525f796ebd.jpg
[postid] => 598
[message] => sweet!
[created_time] => 2012-05-30 21:04:55
)
[time_created] => 3d
[likes] => Array
(
[like_type] => 0
)
[comments] => Array
(
[comments] => 0
)
[user_likes] => Array
(
[user_likes] => 0
)
[user_comments] => Array
(
[user_comments] => 0
)
[user_favorite] => Array
(
[isFav] => 0
)
)
[12] => Array
(
[taskuser] => Array
(
[profilepic] => 1e605ad76c82d41f6467c2525f796ebd.jpg
[postid] => 598
[message] => sweet!
[created_time] => 2012-04-17 15:54:32
)
[time_created] => 3d
[likes] => Array
(
[like_type] => 0
)
[comments] => Array
(
[comments] => 0
)
[user_likes] => Array
(
[user_likes] => 0
)
[user_comments] => Array
(
[user_comments] => 0
)
[user_favorite] => Array
(
[isFav] => 0
)
)
[13] => Array
(
[taskuser] => Array
(
[profilepic] => 1e605ad76c82d41f6467c2525f796ebd.jpg
[postid] => 598
[message] => sweet!
[created_time] => 2012-04-17 15:54:54
)
[time_created] => 3d
[likes] => Array
(
[like_type] => 0
)
[comments] => Array
(
[comments] => 0
)
[user_likes] => Array
(
[user_likes] => 0
)
[user_comments] => Array
(
[user_comments] => 0
)
[user_favorite] => Array
(
[isFav] => 0
)
)
[14] => Array
(
[taskuser] => Array
(
[profilepic] => 1e605ad76c82d41f6467c2525f796ebd.jpg
[postid] => 598
[message] => sweet!
[created_time] => 2012-04-17 15:53:19
)
[time_created] => 3d
[likes] => Array
(
[like_type] => 0
)
[comments] => Array
(
[comments] => 1
)
[user_likes] => Array
(
[user_likes] => 0
)
[user_comments] => Array
(
[user_comments] => 0
)
[user_favorite] => Array
(
[isFav] => 0
)
)
)