title: Sorting array based on value
body: <p>I have an array like so</p>
  
  <pre><code>array:2 [▼
    "folder1" =&gt; array:3 [▼
      1 =&gt; "d1_2.png"
      2 =&gt; "d1_1.png"
      3 =&gt; "d1_3.png"
    ]
    "folder2" =&gt; array:3 [▼
      0 =&gt; "d2_2.png"
      1 =&gt; "d2_3.png"
      3 =&gt; "d2_1.png"
    ]
  ]
  </code></pre>
  
  <p>What I am trying to do is sort this array based on the value.  So the output should be something like this</p>
  
  <pre><code>array:2 [▼
    "folder1" =&gt; array:3 [▼
      0 =&gt; "d1_1.png"
      1 =&gt; "d1_2.png"
      2 =&gt; "d1_3.png"
    ]
    "folder2" =&gt; array:3 [▼
      0 =&gt; "d1_1.png"
      1 =&gt; "d1_2.png"
      2 =&gt; "d1_3.png"
    ]
  ]
  </code></pre>
  
  <p>All examples I have seen sort based on a key value, but I do not have keys.  I have tried several sort functions  but none of them seem to sort the array.</p>
  
  <p>How can I sort it based on the array I have?</p>
  
  <p>Thanks</p>