array_rand() Example
Refreshing the screen should produce different results
(sometimes they'll be the same though since php's random
function isn't that good)
Original Array Values
Array
(
[First] => John
[Second] => Jane
[Third] => Nick
[Fourth] => Betty
)
Randomly selected keys array
Array
(
[0] => First
[1] => Second
[2] => Third
[3] => Fourth
)
Using foreach loop
John
Jane
Nick
Betty
Using regular for loop
John
Jane
Nick
Betty