How to strip dashes out of file basename and display using php?
<p>I'm trying to list links to all the files in a folder on my web site by including the code below in the index page in that folder. </p>

<p>Using this code outputs file names that look like this <code>name-of-file</code> which are linked to <code>name-of-file.html</code>.</p>

<p>Now how do I modify the code below to strip out the slashes and display the file names as <code>name of file</code>? </p>

<p>I'm a php noob so any help will be greatly appreciated. Thanks. </p>

<pre><code>&lt;ul&gt;
    &lt;?php
        $files = glob("*.html");
        foreach($files as $file)
        {
            echo '&lt;li&gt;&lt;a href="'.basename($file).'"&gt;'.basename($file, ".html").'&lt;/a&gt;&lt;/li&gt;';
        }
    ?&gt;
&lt;/ul&gt;
</code></pre>
