So I am looking to alternate between 5 different variables but want the 'load' to be equal on each variable. I have seen it done with just two variables and alternating based on random number generated withe limits being set. But trying to expand that idea on to five variables. Thanks in advance.
Just for example purposes say I had 5 images and wanted each image to be shown equally after 100 tests. This is the easiest way I can think of explaining it.
This is how I did it with only 2 variables but trying to think about how to do it with more.
$ad1 = '<img src... >';
$ad2 = '<img src...2 >';
echo mt_rand(0, 1) ? $ad1 : $ad2;
Source:PHP Switching between two variables equally without using database
So this is what I have going just want to know what the ideas on equally being between the different variables.
$input = array("a", "b", "c", "d");
$rand_keys = array_rand($input);
echo 'var key ="'.$input[$rand_keys].'"';