Ok well that array idea could work..
but what's the filename format of these files?? if they're all contigous or in some kind of pattern there maybe a faster and easier way such as if you have them for example named: file1.ext, file2.ext or some pattern or other.. then you can just use random number func's to do some work with you and all should be good.. ::::::::::::::::::::::::::::::::::::::::::: : Julien Bonastre [The-Spectrum.org CEO] : A.K.A. The_RadiX : [EMAIL PROTECTED] : ABN: 64 235 749 494 : QUT Student #: 04475739 ::::::::::::::::::::::::::::::::::::::::::: ----- Original Message ----- From: "Craig Vincent" <[EMAIL PROTECTED]> To: "Andy" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]> Sent: Monday, May 20, 2002 6:18 PM Subject: RE: [PHP] how to select a file on a random basis? > > I would like to pick a file out of a directory by random. There are 400 > > files and I just want to pick on of those by random. > > > > Is there a way with rand() and file ? > > Well there's a couple ways you could do this...it's too early in the morning > to post code but with some quick searches in the manual you should find all > you need. > > The most dynamic way to do this is to grab all the filenames in the > directory you want, then randomize the array using shuffle....then use the > first cell value in the array. > > If you don't understand what I'm suggesting just lmk =) I'll try explaining > in better detail when I'm more awake hehe. > > Sincerely, > > Craig Vincent > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php