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
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
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;
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
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
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 =
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;
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;
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
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:
10 matches
Mail list logo