title: How to sort the inner array from a multidimensional array in PHP?
body: <p>I'm getting a multidimensional array named <code>$user_alerts</code> generated from the SQL query. For your reference I'm printing the array here:</p>
  
  <pre><code>Array
  (
      [154472] =&gt; Array
          (
              [3829802] =&gt; Array
                  (
                      [34438] =&gt; 34438
                      [34442] =&gt; 34442
                      [34429] =&gt; 34429
                      [34443] =&gt; 34443
                  )
  
              [3830078] =&gt; Array
                  (
                      [34442] =&gt; 34442
                      [34438] =&gt; 34438
                      [34443] =&gt; 34443
                      [34429] =&gt; 34429
                  )
  
              [3829803] =&gt; Array
                  (
                      [34442] =&gt; 34442
                      [34438] =&gt; 34438
                      [34429] =&gt; 34429
                      [34443] =&gt; 34443
                  )
  
          )
  
      [154554] =&gt; Array
          (
              [3831407] =&gt; Array
                  (
                      [34438] =&gt; 34438
                      [34429] =&gt; 34429
                      [34443] =&gt; 34443
                      [34442] =&gt; 34442
                  )
  
              [3831408] =&gt; Array
                  (
                      [34429] =&gt; 34429
                      [34443] =&gt; 34443
                      [34442] =&gt; 34442
                      [34438] =&gt; 34438
                  )
  
          )
  
      [154551] =&gt; Array
          (
              [3831329] =&gt; Array
                  (
                      [34442] =&gt; 34442
                      [34438] =&gt; 34438
                      [34443] =&gt; 34443
                      [34429] =&gt; 34429
                  )
  
          )
  
      [154477] =&gt; Array
          (
              [3830046] =&gt; Array
                  (
                      [34442] =&gt; 34442
                      [34429] =&gt; 34429
                      [34438] =&gt; 34438
                      [34443] =&gt; 34443
                  )
  
              [3829564] =&gt; Array
                  (
                      [34429] =&gt; 34429
                      [34442] =&gt; 34442
                      [34438] =&gt; 34438
                      [34443] =&gt; 34443
                  )
  
          )
  
      [154474] =&gt; Array
          (
              [3829402] =&gt; Array
                  (
                      [34429] =&gt; 34429
                      [34442] =&gt; 34442
                      [34438] =&gt; 34438
                      [34443] =&gt; 34443
                  )
  
          )
  
      [154473] =&gt; Array
          (
              [3829377] =&gt; Array
                  (
                      [34442] =&gt; 34442
                      [34429] =&gt; 34429
                      [34438] =&gt; 34438
                      [34443] =&gt; 34443
                  )
  
          )
  
      [154541] =&gt; Array
          (
              [3831211] =&gt; Array
                  (
                      [34442] =&gt; 34442
                      [34438] =&gt; 34438
                      [34443] =&gt; 34443
                      [34429] =&gt; 34429
                  )
  
          )
  
      [154514] =&gt; Array
          (
              [3830597] =&gt; Array
                  (
                      [34442] =&gt; 34442
                      [34438] =&gt; 34438
                      [34429] =&gt; 34429
                      [34443] =&gt; 34443
                  )
  
          )
  
      [154513] =&gt; Array
          (
              [3830557] =&gt; Array
                  (
                      [34442] =&gt; 34442
                      [34438] =&gt; 34438
                      [34429] =&gt; 34429
                      [34443] =&gt; 34443
                  )
  
          )
  
      [154493] =&gt; Array
          (
              [3830072] =&gt; Array
                  (
                      [34442] =&gt; 34442
                      [34429] =&gt; 34429
                      [34438] =&gt; 34438
                      [34443] =&gt; 34443
                  )
  
              [3829611] =&gt; Array
                  (
                      [34429] =&gt; 34429
                  )
  
          )
  
      [154491] =&gt; Array
          (
              [3829998] =&gt; Array
                  (
                      [34429] =&gt; 34429
                      [34443] =&gt; 34443
                      [34442] =&gt; 34442
                      [34438] =&gt; 34438
                  )
  
          )
  
  )
  </code></pre>
  
  <p>Now I want to sort the internal array in ascending order. 
  The sample internal array which needs to be sorted is as follows(the first inner array element).</p>
  
  <pre><code> [3829802] =&gt; Array
                      (
                          [34438] =&gt; 34438
                          [34442] =&gt; 34442
                          [34429] =&gt; 34429
                          [34443] =&gt; 34443
                      )
  </code></pre>
  
  <p>Actually I want to sort all such inner arrays. I tried lot of tricks but nothing gave me the desired result. Can anyone help me to resolve this issue? Thanks in advance.</p>