Hi
I need to get a random value from the array below but my code only returns the array key, not the value.
How do I get the value returned and not the key?
Array
(
[0] => 1.jpg
[1] => 2.jpg
[2] => 3.jpg
[3] => 4.jpg
[4] => 5.jpg
[5] => 6.jpg
[6] => 7.jpg
[7] => 8.jpg
[8] => 9.jpg
[9] => 10.jpg
[10] => 11.jpg
[11] => 12.jpg
[12] => 13.jpg
[13] => 14.jpg
[14] => 15.jpg
)
My PHP Code:
$imagename = array_rand($my_array, 1);
Many Thanks