Read File Names From folder Only Keep Files with .iso extention
<p>I have a script that gets a string from a config file and based on that string grabs the file names of a folder.</p>

<p>I now only need the iso files. Not sure if the best way is to check for the .iso string or is there another method?</p>

<pre><code>&lt;?php
    // Grab the contents of the "current.conf" file, removing any linebreaks.
    $dirPath = trim(file_get_contents('current.conf')).'/';

    $fileList = scandir($dirPath);

    if(is_array($fileList)) {
        foreach($fileList as $file) {
//could replace the below if statement to only proceed if the .iso string is present. But I am worried there could be issues with this.


         if ($file != "." and $file != ".." and $file != "index.php")
{

            echo "&lt;br/&gt;&lt;a href='". $dirPath.$file."'&gt;" .$file."&lt;/a&gt;\n";
    }
        } 
    }
    else echo $dirPath.' cound not be scanned.';
?&gt;
</code></pre>
