I need to know how to select a random file.
1.php
This file is the file that includes a random file when opened.
Either rand1.php rand2.php or rand3.php
How would I do this?
Something like using an include except it's randomised.
How to select random files...
Moderator: General Moderators
-
Anonymous2
- Forum Newbie
- Posts: 1
- Joined: Sat Jan 31, 2004 11:14 am
Code: Select all
//without the usual validation/checking you'de want to do
$rand = rand(1, 3);
$incfile = 'rand'.$rand.'.php';
require_once $incfile;