title: PHP list all files in directory - with link to file?
body: <p>Related to this post: <a href="https://stackoverflow.com/a/10228005/1064767">"PHP list all files in directory" </a>, specifically the code displayed by "Apr 19 '12 at 12:24 " Kiko"</p>
  
  <p>I was wondering if anyone can suggest how to determine the folder path to the file itself:
  i.e. </p>
  
  <pre><code>$html .= "&lt;li&gt;&lt;span class='file'&gt;&lt;a href='???' target='_blank'&gt;". $eachDirectory ."&lt;/a&gt;&lt;/span&gt;&lt;/li&gt;";
  </code></pre>
  
  <p>S I can wrap an HREF around it so it.  The functions are recursive so I'm not sure at which stage I can determine the path of the file.  Anyone have a way to do this? Thanks! </p>