Re: randomizing amounts of html displayed
| From: | Bas Jobsen | Date: | Thu, 12 Sep 2002 22:02:40 +0000 |
| Subject: | Re: randomizing amounts of html displayed | ||
| References: | 1 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-21725@lists.php.net to get a copy of this message | ||
<?
$numbers = range (0,4);
srand ((float)microtime()*1000000);
shuffle ($numbers);
for($i=0; $i<3; $i++)
echo 'row'.$numbers[$i]."\n";
?>
Op donderdag 12 september 2002 20:58, schreef Aaron Wolski:
> Hi All..
>
> Quick question and perhaps a suggestion/solution requst to the above
> topic. My brain is just not working :(
>
>
> I have a HTML table with 5 rows of data. I would like to randomly
> display 3 of the 5 rows when the page is accessed.
>
>
> For example:
>
>
>
>
>
> Row 1
>
>
> Row 2
>
> Row 3
>
> Row 4
>
> Row 5
>
>
> When the page is loaded only Row 1,2 and 4 are displayed. When someone
> else loads the page rows 2,4 and 5 are displayed.
>
> Any clues on how to make this possible??
>
> Thanks in advance for looking.
>
> Peace.
>
> Aaron