How to sort this type of nested array in PHP (on the basis of timestamp at index no. 6)
<p>I am new to PHP multi-dimentional arrays, So I need 100% working answer please...</p>

<p>I had tried it by using muli-sort and usort function but they are not working for me, honestly i didn't know how to use them in case of multi-dimentional arrays!</p>

<p>In my case (how I am implementing multi-sort), it is only sorting the first day's array</p>

<pre><code>Array ( 
    [0] =&gt; Array ( 
        [0] =&gt; Array ( 
            [0] =&gt; Cycling
            [1] =&gt; 03:30 PM-04:00 PM
            [2] =&gt; Criterium International
            [3] =&gt; 0.5
            [4] =&gt; SN1
            [5] =&gt; 100
            [6] =&gt; 1459524600
        ) 
        [1] =&gt; Array ( 
            [0] =&gt; Rugby
            [1] =&gt; 03:00 PM-05:15 PM
            [2] =&gt; Super League Rugby - Wolves v Warriors
            [3] =&gt; 2.25
            [4] =&gt; SNOverflow
            [5] =&gt; 100
            [6] =&gt; 1459522800 
        ) 
        [2] =&gt; Array (
            [0] =&gt; Rugby 
            [1] =&gt; 05:00am-07:30 AM 
            [2] =&gt; National Rugby League Titans vs Broncos
            [3] =&gt; 2.5 
            [4] =&gt; SNWorld
            [5] =&gt; 100
            [6] =&gt; 1459485000 
        )
    )
    [1] =&gt; Array ( 
        [0] =&gt; Array ( 
            [0] =&gt; Rugby
            [1] =&gt; 09:45 AM-12:00 PM
            [2] =&gt; Super League Rugby - Red Devils v E
            [3] =&gt; 2.25
            [4] =&gt; SNOverflow
            [5] =&gt; 100
            [6] =&gt; 1459590300 
        )
        [1] =&gt; Array (
            [0] =&gt; Rugby
            [1] =&gt; 12:00 PM-02:00 PM
            [2] =&gt; Super League Rugby - Vikings v Dragons
            [3] =&gt; 2
            [4] =&gt; SNOverflow
            [5] =&gt; 100
            [6] =&gt; 1459598400 
        )
        [2] =&gt; Array (
            [0] =&gt; BPL Soccer
            [1] =&gt; 07:30 AM-09:45 AM
            [2] =&gt; Aston Villa v Chelsea
            [3] =&gt; 2.25
            [4] =&gt; SNRegions
            [5] =&gt; 100
            [6] =&gt; 1459582200
        )
    ) 
    [2] =&gt; Array (
        [0] =&gt; Array ( 
            [0] =&gt; The Wheel Highlights
            [1] =&gt; 11:00 PM-12:30 AM
            [2] =&gt;
            [3] =&gt; 1.5
            [4] =&gt; Sportsnet 360
            [5] =&gt; 100
            [6] =&gt; 1459724400
        )
        [1] =&gt; Array (
            [0] =&gt; The Wheel Highlights
            [1] =&gt; 10:00 PM-11:00 PM
            [2] =&gt;
            [3] =&gt; 1
            [4] =&gt; Sportsnet 360
            [5] =&gt; 100
            [6] =&gt; 1459720800
        )
        [2] =&gt; Array (
            [0] =&gt; CHL Hockey 
            [1] =&gt; 06:00 PM-09:00 PM
            [2] =&gt; Brandon @ Edmonton
            [3] =&gt; 3
            [4] =&gt; Sportsnet 360
            [5] =&gt; 100
            [6] =&gt; 1459706400
        )
    ) 
)
</code></pre>

<p>My desired output is like this:</p>

<pre><code>Array ( 
        [0] =&gt; Array ( 
            [0] =&gt; Array ( 
                [0] =&gt; Rugby 
                [1] =&gt; 05:00am-07:30 AM 
                [2] =&gt; National Rugby League Titans vs Broncos
                [3] =&gt; 2.5 
                [4] =&gt; SNWorld
                [5] =&gt; 100
                [6] =&gt; 1459485000 
            ) 
            [1] =&gt; Array ( 
                [0] =&gt; Rugby
                [1] =&gt; 03:00 PM-05:15 PM
                [2] =&gt; Super League Rugby - Wolves v Warriors
                [3] =&gt; 2.25
                [4] =&gt; SNOverflow
                [5] =&gt; 100
                [6] =&gt; 1459522800 
            ) 
            [2] =&gt; Array (
                [0] =&gt; Cycling
                [1] =&gt; 03:30 PM-04:00 PM
                [2] =&gt; Criterium International
                [3] =&gt; 0.5
                [4] =&gt; SN1
                [5] =&gt; 100
                [6] =&gt; 1459524600 
            )
        )
        [1] =&gt; Array ( 
            [0] =&gt; Array ( 
                [0] =&gt; BPL Soccer
                [1] =&gt; 07:30 AM-09:45 AM
                [2] =&gt; Aston Villa v Chelsea
                [3] =&gt; 2.25
                [4] =&gt; SNRegions
                [5] =&gt; 100
                [6] =&gt; 1459582200
            )
            [1] =&gt; Array (
                [0] =&gt; Rugby
                [1] =&gt; 09:45 AM-12:00 PM
                [2] =&gt; Super League Rugby - Red Devils v E
                [3] =&gt; 2.25
                [4] =&gt; SNOverflow
                [5] =&gt; 100
                [6] =&gt; 1459590300 
            )
            [2] =&gt; Array (
                [0] =&gt; Rugby
                [1] =&gt; 12:00 PM-02:00 PM
                [2] =&gt; Super League Rugby - Vikings v Dragons
                [3] =&gt; 2
                [4] =&gt; SNOverflow
                [5] =&gt; 100
                [6] =&gt; 1459598400 
            )
        ) 
        [2] =&gt; Array (
            [0] =&gt; Array ( 
                [0] =&gt; CHL Hockey 
                [1] =&gt; 06:00 PM-09:00 PM
                [2] =&gt; Brandon @ Edmonton
                [3] =&gt; 3
                [4] =&gt; Sportsnet 360
                [5] =&gt; 100
                [6] =&gt; 1459706400
            )
            [1] =&gt; Array (
                [0] =&gt; The Wheel Highlights
                [1] =&gt; 10:00 PM-11:00 PM
                [2] =&gt;
                [3] =&gt; 1
                [4] =&gt; Sportsnet 360
                [5] =&gt; 100
                [6] =&gt; 1459720800
            )
            [2] =&gt; Array (
                [0] =&gt; The Wheel Highlights
                [1] =&gt; 11:00 PM-12:30 AM
                [2] =&gt;
                [3] =&gt; 1.5
                [4] =&gt; Sportsnet 360
                [5] =&gt; 100
                [6] =&gt; 1459724400
            )
        ) 
    )
</code></pre>