title: Sorting in numeric and alphabetical order
body: <p>I came across this block of code which pulls images from a folder specified and outputs them with the <code>img</code> tag:</p>
  
  <pre><code>  &lt;?php
              $url = "./images/";
              $handle = opendir ($url);
              while (false !== ($file = readdir($handle))) {
                  if($file != "." &amp;&amp; $file != ".." &amp;&amp; $file != basename(__FILE__)) {
              echo '&lt;a href="'.$url.$file.'" class="lightbox" title="'.$file.'"&gt;&lt;img src="'.$url.$file.'" alt="" /&gt;&lt;/a&gt;&lt;br /&gt;'; 
  ?&gt;
  </code></pre>
  
  <p>This works great, but the only thing I am having issues with is the ordering of the images.</p>
  
  <p>So, let's say in my <code>images</code> folder, I have these images:</p>
  
  <pre><code>2.jpg
  b.jpg
  a.jpg
  1.jpg
  </code></pre>
  
  <p>How can I make it so that it lists the images in numeric and alphabetical order? I would like the numbered images to come first then the alphabets, so it would list the images like this:</p>
  
  <pre><code>1.jpg
  2.jpg
  a.jpg
  b.jpg
  </code></pre>