title: Read all files in a directory and return a list in php
body: <p>With scandir i can get the files but they are ugly displayed: </p>
  
  <pre><code>Array ( [0] =&gt; . [1] =&gt; .. [2] =&gt; jan-spaceship.jpg [3] =&gt; jan-tychostation.jpg [4] =&gt; johan-mars.jpg [5] =&gt; mary-132786.jpg [6] =&gt; mary-mars.jpg )
  </code></pre>
  
  <p>What i want is a custom div with the name and maybe even display the image (it are all images). Is that possible with a foreach loop or a for loop?</p>