I wrote some code that I thought would mix up my image names and serve up a random image. But each time I run it I get the same exact order of the array (all mixed up, but always in the same order) so I just keep getting the same image name over and over.
What am I doing wrong here???
Here is the code:
<?php /* Include File to define photo array for radom photos */
$picturesArray = array("class_1.jpg", "class_2.jpg", "class_3.jpg", "class_4.jpg",
"class_5.jpg", "class_6.jpg", "class_7.jpg", "class_8.jpg");
shuffle($picturesArray);
while (list ($key, $val)= each($picturesArray)){
echo "Index[".$key."] = ".$val."<br />";
}
?>