title: opendir error with first two images codeigniter
body: <p>i am reading from a directory which everything it looks fine. I am able to display all the data inside the folder but i have a problem, in the beginning of the list it shows 2 broken images which are not mine they have a strange path it looks like is generated it self, here is the strange path in the source file: </p>
  
  <blockquote>
    <p>(Resource id #33&lt; ul >&lt; li >&lt; a href="#">&lt; img src="img/test/.">&lt; /
    a>&lt; / li>&lt; li>&lt; a href="#" >&lt; img src="img/test/..">&lt; /a> )</p>
  </blockquote>
  
  <p>The code continue normally as it should reading the images inside the folder after these two lines.</p>
  
  <p>And here is the code i am using:</p>
  
  <pre><code>class HomeModel extends CI_Model{
  
  public function getData(){
  
  $dir = 'img/test';
  
  echo opendir($dir);
  
  if (is_dir($dir)) {
  
      if ($dh = opendir($dir)) {
  
       $display_models = '&lt;ul&gt;';
  
          while (($file = readdir($dh)) !== false) {
  
      $display_models .= '&lt;li&gt;&lt;a href="#"&gt;&lt;img src="'.$dir.'/'.$file.'"&gt;&lt;/a&gt;&lt;/li&gt;';
  
          }
  
      $display_models .= '&lt;/ul&gt;';
  
          closedir($dh);
  
      }
  
        return $display_models;
  }
  
  }
  
  }
  </code></pre>