How to retrieve files on a directory in list using PHP
<p>How may i able to retrieve different file extensions in a certain directory. Let say i have a folder named "downloads/", where inside that folder are different types of files like PDFs, JPEGs, DOC files etc. So in my PHP code i wanted those files be retrieved and listed with there file names and file extensions. Example: Inside "downloads/" folder are different files</p>

<pre><code>downloads/

 - My Poem.doc
 - My Photographs.jpg
 - My Research.pdf
</code></pre>

<p>So i wanted to view those files where i can get there file names, file extensions, and file directories. So in view will be something like this</p>

<pre><code>Title: My Poem
Type: Document
Link: [url here] 

Title: My Photographs
Type: Image
Link: [url here] 

Title: My Research
Type: PDF
Link: [url here] 
</code></pre>

<p>Anyone knows how to do it in php? Thanks a lot!</p>
