Re: [PHP] Random Images with no duplicates?

2005-12-20 Thread Mike
Mike [EMAIL PROTECTED] wrote in message news:... I'd just like to thank everyone who helped me our with this. I think it's great that so many people would be so helpful and not expect anything in return. This list is quite a storehouse of info and I'm learning just from reading the posts

Re: [PHP] Random Images with no duplicates?

2005-12-19 Thread Mike
I'd just like to thank everyone who helped me our with this. I think it's great that so many people would be so helpful and not expect anything in return. This list is quite a storehouse of info and I'm learning just from reading the posts since I joined last week! Again, thanks all. -Mike

Re: [PHP] Random Images with no duplicates?

2005-12-18 Thread Silvio Porcellana [tradeOver]
Jared Williams wrote: Hi, Just unset the ones you've picked ?php #random images example #this is your file $file = images.txt; #open the file $openFile = file($file); #generate a random number srand((double)microtime()*100); #get one of the entries in the file for ($i = 0;

Re: [PHP] Random Images with no duplicates?

2005-12-18 Thread Silvio Porcellana [tradeOver]
Silvio Porcellana [tradeOver] wrote: code $file = images.txt; $openFile = file($file); $num_images = 10; # don't need this is PHP 4.2.0 srand((float) microtime() * 1000); $random_keys = array_rand($openFile, $num_images); foreach

RE: [PHP] Random Images with no duplicates?

2005-12-16 Thread Kilbride, James
choices. -Original Message- From: Curt Zirzow [mailto:[EMAIL PROTECTED] Sent: Friday, December 16, 2005 2:47 AM To: php-general@lists.php.net Subject: Re: [PHP] Random Images with no duplicates? On Thu, Dec 15, 2005 at 08:45:33PM -0800, Mike Rondeau wrote: Hi, I'm still very

RE: [PHP] Random Images with no duplicates?

2005-12-16 Thread Jared Williams
Hi, Just unset the ones you've picked ?php #random images example #this is your file $file = images.txt; #open the file $openFile = file($file); #generate a random number srand((double)microtime()*100); #get one of the entries in the file for ($i = 0; $i 10; ++$i) { $r =

[PHP] Random Images with no duplicates?

2005-12-15 Thread Mike Rondeau
Hi, I'm still very green with PHP, but am working to fix that. I've searched high and low for an answer to this question and so far no solution has presented itself. I have a script to populate my web page with random images: ?php #random images example #this is your file $file = images.txt;

[PHP] Random Images with no duplicates?

2005-12-15 Thread Mike
Hi, I'm still very green with PHP, but am working to fix that. I've searched high and low for an answer to this question and so far no solution has presented itself. I have a script to populate my web page with random images: ?php #random images example #this is your file $file = images.txt;

Re: [PHP] Random Images with no duplicates?

2005-12-15 Thread Aaron Koning
This should work, although if there are only 9 lines in the file, it will run infintely (or until the page times out)... so put a check in for that. $imagesNeeded = 10; $imageArr = array(); // Create array with $imagesNeeded number of elements. for($i=0;$i$imagesNeeded;$i++) { // choose image

Re: [PHP] Random Images with no duplicates?

2005-12-15 Thread Curt Zirzow
On Thu, Dec 15, 2005 at 08:45:33PM -0800, Mike Rondeau wrote: Hi, I'm still very green with PHP, but am working to fix that. I've searched high and low for an answer to this question and so far no solution has presented itself. I have a script to populate my web page with random images: