title: List files in directory in codeigniter/php
body: <p>I am trying to list all files within a directory alphabetically.  For the most part, what I have works but there are some strange random ones at the bottom of the list which get mixed up.</p>
  
  <p>Can anyone help?</p>
  
  <pre><code>$files = directory_map('downloads/human_resources');
  
  asort($files);
  
  foreach($files as $file){
      if(is_string($file)){
          echo $file[1];
      }
  }
  </code></pre>