Hi,
I'm trying to preventing consecutive duplicate pages.
For example when I refreshed a page it show a word from each page and when I refresh again it should show a different word from a different page not staying on one page.
This is my pages:
Page1 = Mozart
Page2 = Bach
Page3 = Choplin
Page4 = Brahms
Page5 = Beethoven
Page6 = Schumann
I'm using these functions: rand(), shuffle(), sort(), array(), for my code.
This is my whole code so far:
<?php
$num=rand(1,6);
shuffle($num);
for ($m=0; $m<6; $m++) {
$result[$m]=$num[$m];
sort($result);
$m = array("page1.php" => "page1.php", "page2.php" => "page2.php", "page3.php" => "page3.php", "page4.php" => "page4.php", "page5.php" => "page5.php", "page6.php" => "page6.php");
echo $num;
}
?>
The only thing it echo out is the array number.
Also this error: shuffle() expects parameter 1 to be array
Any Suggestions and explanation will help. I appreciate it. Thanks!