How to automatically update links to files in specific folder?
<p>First of all I'm an amateur when it comes to php so any help is appreciated. I have found this piece of code but I want it to only archive certain file extension (.php or .html). Furthermore I want the link to NOT display the first 5 letters from the file name and to also NOT display the file extension.</p>

<pre><code>&lt;?php
$dirname = 'news'; 
$webdirname = '/news_folder'; /

$dir = opendir($dirname);
$file_list = '';

while(($file = readdir($dir)) != false) {
if(($file != '.') &amp;&amp; ($file != '..')) {
$file_list .= "&lt;a href=\"$webdirname/$file\"&gt;$file&lt;/a&gt;&lt;br/&gt;";
}
}

closedir($dir);
?&gt;

&lt;p&gt;
&lt;?=$file_list?&gt;
&lt;/p&gt;
</code></pre>
