Tutorial Randomize Background Image
1. Above the DOCTYPE Set up and array of filenames, which correspond to the file names of the images you are trying to randomize. $bg = ar...
https://iskablogs.blogspot.com/2014/03/tutorial-randomize-background-image.html
1. Above the DOCTYPE
Set up and array of filenames, which correspond to the file names of the images you are trying to randomize.
$bg = array('bg-01.jpg', 'bg-02.jpg', 'bg-03.jpg', 'bg-04.jpg', 'bg-05.jpg', 'bg-06.jpg', 'bg-07.jpg' ); // array of filenames
$i = rand(0, count($bg)-1); // generate random number size of the array
$selectedBg = "$bg[$i]"; // set variable equal to
Set up and array of filenames, which correspond to the file names of the images you are trying to randomize.
$bg = array('bg-01.jpg', 'bg-02.jpg', 'bg-03.jpg', 'bg-04.jpg', 'bg-05.jpg', 'bg-06.jpg', 'bg-07.jpg' ); // array of filenames
$i = rand(0, count($bg)-1); // generate random number size of the array
$selectedBg = "$bg[$i]"; // set variable equal to