title: Order a directory alphabetically
body: <p>I have some code that prints out the contents of a directory onto a webpage, what seems to be escaping me is how to make it print out alphabetically.</p>
  
  <pre><code>&lt;?php
  
   $dir="../zpress/pages"; // Directory where files are stored
  
   if ($dir_list = opendir($dir))
   {
   while(($filename = readdir($dir_list)) !== false)
   if(!is_dir($filename))
   {
    ?&gt;
    &lt;p&gt;&lt;a href="../zpress/pages/&lt;?php echo $filename; ?&gt;"&gt;&lt;?php echo $filename;
    ?&gt;&lt;/a&gt;&lt;/p&gt;
    &lt;?php
    }
    closedir($dir_list);
    }
  
    ?&gt;
  </code></pre>
  
  <p>Any suggestion would be most welcome.</p>