Here's the code I'm using:
<?php
$input = array("Test1", "Test1", "Test1", "Test1","Test2");
$rand_keys = array_rand($input, 2);
echo $input[$rand_keys[0]];
?>
Bascially I want to echo Test1
and Test2
randomly - BUT I want Test1
to show up 4x more than Test2
does.
I'm guessing that by adding it in 4 times more than Test2, it should show up 4 times more - is that code correct or should I be doing it a different way?