title: php reorder array of strings
body: <p>I have an array of strings corresponding to names of images in a directory.</p>
  
  <p>Here is an example:</p>
  
  <pre><code>    array(3) { [0]=&gt; string(5) "3.png" [1]=&gt; string(5) "2.jpg" [2]=&gt; string(6) "4.jpeg" }
  </code></pre>
  
  <p>How could I reorder that array so that the numbers before the extensions increases such as the example below: </p>
  
  <pre><code>    array(3) { [0]=&gt; string(5) "2.jpg" [1]=&gt; string(5) "3.png"  [2]=&gt; string(6) "4.jpeg" }
  </code></pre>