File Names Into Array

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View

right so im in the midst of creating a gallery for a friend of mine, i
have most of it right, but when i get the file names from the directory
and into an array i have the ".." and "..." as the first two elements,
any ideas?

my getImages functions is simply as follows:


function getImages()
    global $images;
        $mydir = opendir(images);

        for($i=0; $i<10; $i++)
                $entryname = readdir($mydir);
                $images[] = $entryname;

Re: File Names Into Array

I noticed that Message-ID: contained the following:

Quoted text here. Click to load it

Well I don't think that's the only problem with this function.  The only
thing it appears to output is line breaks.

This snippet from one of my scripts might help.

 if ($dh = opendir($dir)) {
       while (($file = readdir($dh)) !== false) {
           echo "<tr><td>filename:&nbsp;</td><td><b> <a
href=\"$file\">$file</a></b></td><td>Type:&nbsp</td><td>". filetype($dir
.. $file)."</td><td align=\"center\"><input
type=\"checkbox\"name=\"delete[]\" value=\"$file\"><td></tr>\n";
Geoff Berrow (put thecat out to email)
It's only Usenet, no one dies.
My opinions, not the committee's, mine.
Simple RFDs /

Site Timeline