Hi there, I basically need something to rotate a few "questions". So when you load the page it will show you one random question and when you refresh it will show you a different one. I need to rotate about 5 questions. Anyone know how I could do this? Thanks in advance, Peter Brown
Something like that should work : <? $question = array('question1' ,'question2',...,'question5'); $rand = mt_rand(0, count($question)-1); echo $question[$rand]; ?> PHP: It will randomly pull a question from the array.
Monty, I have some include in my root: 1.inc.php , 2.inc.php , etc... Can I go: <php? $include = array('1.inc.php code' ,'2.inc.php code' ,...,); $rand = mt_rand(0, count($include)-1); echo $include[$rand]; ?> and instead of the code, how can I call the includes?