mobilebadboy
07-04-2004, 10:48 PM
I'm going to have a dozen or so files (containing text/images) that I'd like to randomize/rotate on the front page of a site. The thing is, I want to display roughly 3 or 4 at the same time, and I can't have duplicates.
Anyone have any insight? Say I have file1.php, file2.php, file3.php, file4.php, file5.php and file6.php. I want to display on my site:
file[x]
file[x]
file[x]
But I can't have duplicates. If I had a set number of files I could create 3 arrays with the files split between them, to assure uniques, but the number of files will always change and I'd like to have them show higher or lower at random, not have the same set of files in the same position every time.
If it can't be done with PHP, I'll accept a Javascript solution.
Anyone have any insight? Say I have file1.php, file2.php, file3.php, file4.php, file5.php and file6.php. I want to display on my site:
file[x]
file[x]
file[x]
But I can't have duplicates. If I had a set number of files I could create 3 arrays with the files split between them, to assure uniques, but the number of files will always change and I'd like to have them show higher or lower at random, not have the same set of files in the same position every time.
If it can't be done with PHP, I'll accept a Javascript solution.