title: How do i sort an array of array in PHP?
body: <p>Hi I have below strustrue</p>
  
  <pre><code>[1] =&gt; Array
      (
          [menuName] =&gt; Apps
          [menuUrl] =&gt; /Apps
          [Invisible_Mode] =&gt; 
          [subMenu] =&gt; Array
              (
                  [0] =&gt; Array
                      (
                          [subMenuName] =&gt; Collaboration
                          [subMenuUrl] =&gt; /Apps/Collaboration
                          [subitemCount] =&gt; 5
                          [Invisible_Mode] =&gt; 
                      )
  
                  [1] =&gt; Array
                      (
                          [subMenuName] =&gt; Sales
                          [subMenuUrl] =&gt; /Apps/Sales
                          [subitemCount] =&gt; 11
                          [Invisible_Mode] =&gt; 
                      )
  
                  [2] =&gt; Array
                      (
                          [subMenuName] =&gt; Project Management
                          [subMenuUrl] =&gt; /Apps/Project-Management
                          [subitemCount] =&gt; 5
                          [Invisible_Mode] =&gt; 
                      )
  
                  [3] =&gt; Array
                      (
                          [subMenuName] =&gt; Human Resources
                          [subMenuUrl] =&gt; /Apps/Human-Resources
                          [subitemCount] =&gt; 7
                          [Invisible_Mode] =&gt; 
                      )
  
                  [4] =&gt; Array
                      (
                          [subMenuName] =&gt; Marketing
                          [subMenuUrl] =&gt; /Apps/Marketing
                          [subitemCount] =&gt; 8
                          [Invisible_Mode] =&gt; 
                      ) ) )
  </code></pre>
  
  <p>i need array like below (using the above array),</p>
  
  <pre><code>[1] =&gt; Array
      (
          [menuName] =&gt; Apps
          [menuUrl] =&gt; /Apps
          [Invisible_Mode] =&gt; 
          [subMenu] =&gt; Array
              (
                  [Collaboration] =&gt; Array
                      (
                          [subMenuName] =&gt; Collaboration
                          [subMenuUrl] =&gt; /Apps/Collaboration
                          [subitemCount] =&gt; 5
                          [Invisible_Mode] =&gt; 
                      )
  
                  [Sales] =&gt; Array
                      (
                          [subMenuName] =&gt; Sales
                          [subMenuUrl] =&gt; /Apps/Sales
                          [subitemCount] =&gt; 11
                          [Invisible_Mode] =&gt; 
                      )
  
                  [Project Management] =&gt; Array
                      (
                          [subMenuName] =&gt; Project Management
                          [subMenuUrl] =&gt; /Apps/Project-Management
                          [subitemCount] =&gt; 5
                          [Invisible_Mode] =&gt; 
                      )
  
                  [Human Resources] =&gt; Array
                      (
                          [subMenuName] =&gt; Human Resources
                          [subMenuUrl] =&gt; /Apps/Human-Resources
                          [subitemCount] =&gt; 7
                          [Invisible_Mode] =&gt; 
                      )
  
                  [Marketing] =&gt; Array
                      (
                          [subMenuName] =&gt; Marketing
                          [subMenuUrl] =&gt; /Apps/Marketing
                          [subitemCount] =&gt; 8
                          [Invisible_Mode] =&gt; 
                      ) ) )
  </code></pre>
  
  <p>How can i do this?</p>