Say I have the following array:
$var = array(
"green" => array("one", "two"),
"red" => array("three", "four"),
"yellow" => array("five", "six")
);
What code would I need to write to generate a random output of any of the numbers?
I've tried the following, which will give me either "one", "three" or "five".
$section = array_rand($var);
echo $var[$section][0];
However I can't seem to randomise the key, so it will randomly choose a colour, and then randomly choose a number within that colour. I'm obviously having a dim moment. Can anyone enlighten me? Thanks.