I have some code that I use to display random images, which it draws from a list of possibilities. My problem is that I want to be able to echo the name of the randomized image as text below it. If someone could help me figure out how to do it, I would be very much grateful.
This is the code that randomizes the images:
<?php
echo "<img src=" . $regular[array_rand($regular,1)] . ">\n";
echo "<img src=" . $regular[array_rand($regular,1)] . ">\n";
echo "<img src=" . $regular[array_rand($regular,1)] . ">\n";
?>
The code draws from a file that reads like this:
<?php
$regular = array (
"cards/moon01.gif",
"cards/moon02.gif",
"cards/moon03.gif"
);
?>