Is there any way to show a unique random item from an array, every time you refresh the page? In other words how do I show the items from an array in random order, one by one, by reloading the page?
Moreover the page have to be refreshed by pressing the "submit" button...
Thats what I achieved so far :) but it doesn't display the UNIQUE array item every time the page is reloaded...
as you may guess :)
Expand|Select|Wrap|Line Numbers
- <html>
- <head><title></title></head>
- <body>
- <?php
- $testArray = array ("one","two","three","four","five");
- $number = rand(0,4);
- echo "$testArray[$number]";
- ?>
- <form method="post" action="test.php">
- <input type="submit" value="Submit">
- </form>
- </body>
- </html>
I'm a designer/ActionScript sort of a guy and know nothing about php,
so please don't laugh. :)
Any help is appreciated
Philip