I am using the following script for listing the files in a particular directory as a hyperlink list. The files names which i have mentioned must not be displayed (like index.php), How do i change the code for this?

<?php
 $directory = '';
 foreach (glob($directory . "*.php") as $file) {
    $parts = pathinfo($file);
    $name = preg_replace("/-/", " ", $parts['filename']);
    echo "<li><a href=\"{$file}\">{$name}</a></li>";
 }
 ?>
Member Avatar for diafol

The files names which i have mentioned must not be displayed

Does this make sense? You don't want to display the files?
You haven't mentioned any file names.
Please elaborate.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.