PHP sort complex multidimensional array
<p>I've been struggling trying to sort this array in PHP by "user_likes" and "created_time" I've looked at a few example on Stackoverflow but can't figure out the correct syntax. I want the order to go from the most "user_likes" and then "created_time" not sure if it's even possible. I've been trying with array_multisort with no luck.</p>

<pre><code>        Array
            (
                [0] =&gt; Array
                    (
                        [taskuser] =&gt; Array
                            (
                                [profilepic] =&gt; 1e605ad76c82d41f6467c2525f796ebd.jpg
                                [postid] =&gt; 598
                                [message] =&gt; sweet!
                                  [created_time] =&gt; 2012-04-23 13:53:58
                            )

                        [time_created] =&gt; 3d
                        [likes] =&gt; Array
                            (
                                [like_type] =&gt; 0
                            )

                        [comments] =&gt; Array
                            (
                                [comments] =&gt; 0
                            )

                        [user_likes] =&gt; Array
                            (
                                [user_likes] =&gt; 0
                            )

                        [user_comments] =&gt; Array
                            (
                                [user_comments] =&gt; 0
                            )

                        [user_favorite] =&gt; Array
                            (
                                [isFav] =&gt; 0
                            )

                    )

                [1] =&gt; Array
                    (
                        [taskuser] =&gt; Array
                            (
                                [profilepic] =&gt; 1e605ad76c82d41f6467c2525f796ebd.jpg
                                [postid] =&gt; 598
                                [message] =&gt; sweet!
                                  [created_time] =&gt; 2012-04-23 14:05:20
                            )

                        [time_created] =&gt; 3d
                        [likes] =&gt; Array
                            (
                                [like_type] =&gt; 0
                            )

                        [comments] =&gt; Array
                            (
                                [comments] =&gt; 0
                            )

                        [user_likes] =&gt; Array
                            (
                                [user_likes] =&gt; 0
                            )

                        [user_comments] =&gt; Array
                            (
                                [user_comments] =&gt; 0
                            )

                        [user_favorite] =&gt; Array
                            (
                                [isFav] =&gt; 0
                            )

                    )

                [2] =&gt; Array
                    (
                        [taskuser] =&gt; Array
                            (
                                [profilepic] =&gt; 1e605ad76c82d41f6467c2525f796ebd.jpg
                                [postid] =&gt; 598
                                [message] =&gt; sweet!
                                  [created_time] =&gt; 2012-04-23 14:09:11
                            )

                        [time_created] =&gt; 3d
                        [likes] =&gt; Array
                            (
                                [like_type] =&gt; 0
                            )

                        [comments] =&gt; Array
                            (
                                [comments] =&gt; 0
                            )

                        [user_likes] =&gt; Array
                            (
                                [user_likes] =&gt; 0
                            )

                        [user_comments] =&gt; Array
                            (
                                [user_comments] =&gt; 0
                            )

                        [user_favorite] =&gt; Array
                            (
                                [isFav] =&gt; 0
                            )

                    )

                [3] =&gt; Array
                    (
                        [taskuser] =&gt; Array
                            (
                                [profilepic] =&gt; 1e605ad76c82d41f6467c2525f796ebd.jpg
                                [postid] =&gt; 598
                                [message] =&gt; sweet!
                                  [created_time] =&gt; 2012-04-23 14:11:35
                            )

                        [time_created] =&gt; 3d
                        [likes] =&gt; Array
                            (
                                [like_type] =&gt; 0
                            )

                        [comments] =&gt; Array
                            (
                                [comments] =&gt; 0
                            )

                        [user_likes] =&gt; Array
                            (
                                [user_likes] =&gt; 0
                            )

                        [user_comments] =&gt; Array
                            (
                                [user_comments] =&gt; 0
                            )

                        [user_favorite] =&gt; Array
                            (
                                [isFav] =&gt; 0
                            )

                    )

                [4] =&gt; Array
                    (
                        [taskuser] =&gt; Array
                            (
                                [profilepic] =&gt; 1e605ad76c82d41f6467c2525f796ebd.jpg
                                [postid] =&gt; 598
                                [message] =&gt; sweet!
                                  [created_time] =&gt; 2012-05-25 11:22:17
                            )

                        [time_created] =&gt; 3d
                        [likes] =&gt; Array
                            (
                                [like_type] =&gt; 3
                            )

                        [comments] =&gt; Array
                            (
                                [comments] =&gt; 1
                            )

                        [user_likes] =&gt; Array
                            (
                                [user_likes] =&gt; 0
                            )

                        [user_comments] =&gt; Array
                            (
                                [user_comments] =&gt; 0
                            )

                        [user_favorite] =&gt; Array
                            (
                                [isFav] =&gt; 0
                            )

                    )

                [5] =&gt; Array
                    (
                        [taskuser] =&gt; Array
                            (
                                [profilepic] =&gt; 1e605ad76c82d41f6467c2525f796ebd.jpg
                                [postid] =&gt; 598
                                [message] =&gt; sweet!
                                  [created_time] =&gt; 2012-04-17 15:56:00
                            )

                        [time_created] =&gt; 3d
                        [likes] =&gt; Array
                            (
                                [like_type] =&gt; 0
                            )

                        [comments] =&gt; Array
                            (
                                [comments] =&gt; 0
                            )

                        [user_likes] =&gt; Array
                            (
                                [user_likes] =&gt; 0
                            )

                        [user_comments] =&gt; Array
                            (
                                [user_comments] =&gt; 0
                            )

                        [user_favorite] =&gt; Array
                            (
                                [isFav] =&gt; 0
                            )

                    )

                [6] =&gt; Array
                    (
                        [taskuser] =&gt; Array
                            (
                                [profilepic] =&gt; 1e605ad76c82d41f6467c2525f796ebd.jpg
                                [postid] =&gt; 598
                                [message] =&gt; sweet!
                                  [created_time] =&gt; 2012-04-17 15:58:03
                            )

                        [time_created] =&gt; 3d
                        [likes] =&gt; Array
                            (
                                [like_type] =&gt; 0
                            )

                        [comments] =&gt; Array
                            (
                                [comments] =&gt; 0
                            )

                        [user_likes] =&gt; Array
                            (
                                [user_likes] =&gt; 0
                            )

                        [user_comments] =&gt; Array
                            (
                                [user_comments] =&gt; 0
                            )

                        [user_favorite] =&gt; Array
                            (
                                [isFav] =&gt; 0
                            )

                    )

                [7] =&gt; Array
                    (
                        [taskuser] =&gt; Array
                            (
                                [profilepic] =&gt; 1e605ad76c82d41f6467c2525f796ebd.jpg
                                [postid] =&gt; 598
                                [message] =&gt; sweet!
                                  [created_time] =&gt; 2012-04-20 16:24:53
                            )

                        [time_created] =&gt; 3d
                        [likes] =&gt; Array
                            (
                                [like_type] =&gt; 0
                            )

                        [comments] =&gt; Array
                            (
                                [comments] =&gt; 0
                            )

                        [user_likes] =&gt; Array
                            (
                                [user_likes] =&gt; 0
                            )

                        [user_comments] =&gt; Array
                            (
                                [user_comments] =&gt; 0
                            )

                        [user_favorite] =&gt; Array
                            (
                                [isFav] =&gt; 0
                            )

                    )

                [8] =&gt; Array
                    (
                        [taskuser] =&gt; Array
                            (
                                [profilepic] =&gt; 1e605ad76c82d41f6467c2525f796ebd.jpg
                                [postid] =&gt; 598
                                [message] =&gt; sweet!
                                  [created_time] =&gt; 2012-05-11 15:56:55
                            )

                        [time_created] =&gt; 3d
                        [likes] =&gt; Array
                            (
                                [like_type] =&gt; 1
                            )

                        [comments] =&gt; Array
                            (
                                [comments] =&gt; 0
                            )

                        [user_likes] =&gt; Array
                            (
                                [user_likes] =&gt; 0
                            )

                        [user_comments] =&gt; Array
                            (
                                [user_comments] =&gt; 0
                            )

                        [user_favorite] =&gt; Array
                            (
                                [isFav] =&gt; 0
                            )

                    )

                [9] =&gt; Array
                    (
                        [taskuser] =&gt; Array
                            (
                               [profilepic] =&gt; 1e605ad76c82d41f6467c2525f796ebd.jpg
                                [postid] =&gt; 598
                                [message] =&gt; sweet!
                                  [created_time] =&gt; 2012-05-11 16:05:35
                            )

                        [time_created] =&gt; 3d
                        [likes] =&gt; Array
                            (
                                [like_type] =&gt; 1
                            )

                        [comments] =&gt; Array
                            (
                                [comments] =&gt; 4
                            )

                        [user_likes] =&gt; Array
                            (
                                [user_likes] =&gt; 0
                            )

                        [user_comments] =&gt; Array
                            (
                                [user_comments] =&gt; 0
                            )

                        [user_favorite] =&gt; Array
                            (
                                [isFav] =&gt; 0
                            )

                    )

                [10] =&gt; Array
                    (
                        [taskuser] =&gt; Array
                            (
                               [profilepic] =&gt; 1e605ad76c82d41f6467c2525f796ebd.jpg
                                [postid] =&gt; 598
                                [message] =&gt; sweet!
                                  [created_time] =&gt; 2012-05-30 21:04:00
                            )

                        [time_created] =&gt; 3d
                        [likes] =&gt; Array
                            (
                                [like_type] =&gt; 0
                            )

                        [comments] =&gt; Array
                            (
                                [comments] =&gt; 0
                            )

                        [user_likes] =&gt; Array
                            (
                                [user_likes] =&gt; 0
                            )

                        [user_comments] =&gt; Array
                            (
                                [user_comments] =&gt; 0
                            )

                        [user_favorite] =&gt; Array
                            (
                                [isFav] =&gt; 0
                            )

                    )

                [11] =&gt; Array
                    (
                        [taskuser] =&gt; Array
                            (
                               [profilepic] =&gt; 1e605ad76c82d41f6467c2525f796ebd.jpg
                                [postid] =&gt; 598
                                [message] =&gt; sweet!
                                  [created_time] =&gt; 2012-05-30 21:04:55
                            )

                        [time_created] =&gt; 3d
                        [likes] =&gt; Array
                            (
                                [like_type] =&gt; 0
                            )

                        [comments] =&gt; Array
                            (
                                [comments] =&gt; 0
                            )

                        [user_likes] =&gt; Array
                            (
                                [user_likes] =&gt; 0
                            )

                        [user_comments] =&gt; Array
                            (
                                [user_comments] =&gt; 0
                            )

                        [user_favorite] =&gt; Array
                            (
                                [isFav] =&gt; 0
                            )

                    )

                [12] =&gt; Array
                    (
                        [taskuser] =&gt; Array
                            (
                                [profilepic] =&gt; 1e605ad76c82d41f6467c2525f796ebd.jpg
                                [postid] =&gt; 598
                                [message] =&gt; sweet!
                                  [created_time] =&gt; 2012-04-17 15:54:32
                            )

                        [time_created] =&gt; 3d
                        [likes] =&gt; Array
                            (
                                [like_type] =&gt; 0
                            )

                        [comments] =&gt; Array
                            (
                                [comments] =&gt; 0
                            )

                        [user_likes] =&gt; Array
                            (
                                [user_likes] =&gt; 0
                            )

                        [user_comments] =&gt; Array
                            (
                                [user_comments] =&gt; 0
                            )

                        [user_favorite] =&gt; Array
                            (
                                [isFav] =&gt; 0
                            )

                    )

                [13] =&gt; Array
                    (
                        [taskuser] =&gt; Array
                            (
                                [profilepic] =&gt; 1e605ad76c82d41f6467c2525f796ebd.jpg
                                [postid] =&gt; 598
                                [message] =&gt; sweet!
                                  [created_time] =&gt; 2012-04-17 15:54:54
                            )

                        [time_created] =&gt; 3d
                        [likes] =&gt; Array
                            (
                                [like_type] =&gt; 0
                            )

                        [comments] =&gt; Array
                            (
                                [comments] =&gt; 0
                            )

                        [user_likes] =&gt; Array
                            (
                                [user_likes] =&gt; 0
                            )

                        [user_comments] =&gt; Array
                            (
                                [user_comments] =&gt; 0
                            )

                        [user_favorite] =&gt; Array
                            (
                                [isFav] =&gt; 0
                            )

                    )

                [14] =&gt; Array
                    (
                        [taskuser] =&gt; Array
                            (
                                [profilepic] =&gt; 1e605ad76c82d41f6467c2525f796ebd.jpg
                                [postid] =&gt; 598
                                [message] =&gt; sweet!
                                  [created_time] =&gt; 2012-04-17 15:53:19
                            )

                        [time_created] =&gt; 3d
                        [likes] =&gt; Array
                            (
                                [like_type] =&gt; 0
                            )

                        [comments] =&gt; Array
                            (
                                [comments] =&gt; 1
                            )

                        [user_likes] =&gt; Array
                            (
                                [user_likes] =&gt; 0
                            )

                        [user_comments] =&gt; Array
                            (
                                [user_comments] =&gt; 0
                            )

                        [user_favorite] =&gt; Array
                            (
                                [isFav] =&gt; 0
                            )

                    )

            )
</code></pre>
