Fill up an array IF statement
<pre><code>&lt;?php 
if ($handle = opendir('gallery3/var/thumbs/Captain-America/')) { 
    while (false !== ($file = readdir($handle))) { 
        if ($file != "." &amp;&amp; $file != "..") { 
            echo "$file\n";?&gt;&lt;br/&gt;&lt;? 
            echo rtrim($file, '.jpg');?&gt;&lt;br/&gt;&lt;?
            $names[]=$file;
        } 
    } 
    closedir($handle);
}    
?&gt;
</code></pre>

<p>I want to createa an array of the file names that are outputting and also the rtrim elements.</p>
