Re: how to question...

From: Date: Fri, 05 Apr 2002 11:31:49 +0000
Subject: Re: how to question...
References: 1  Groups: php.db 
Request: Send a blank email to php-db+get-18242@lists.php.net to get a copy of this message
Hi Jas, if I understood your question right, you can solve your problem best with something like the following: <?php $i=0; // counter $files = array(); // array to store directory content // open directory $dir = opendir("PATH_TO_DIR"); // loop through directory and put filenames into an array while ($file = readdir($dir)) { $files[$i] = $file; $i++; } // close directory closedir($dir); // now do something reasonable with your array ?> Bob "Jas" <jlgerfen@hotmail.com> schrieb im Newsbeitrag news:20020404214251.60180.qmail@pb1.pair.com... > Ok here is what I would like to accomplish, I am sure someone has done > something like this but I need an example to go from since I am still not > able to write php from scratch... > I need to write a function to count the contents of a directory, like the > file names and place them into an array so I can use a select box to select > the file path in which I would like to save to database, like I said I don't > want someone to do it for me, I just need a resource such as a tutorial or > example to run with. Thanks a ton, > Jas > >

« previous php.db (#18242) next »