I have to generate random image from a directory. I know which is simple like,
$dire=\"images/\"; $images = glob($dire. \'*.{jpg,jpeg,png,gif}\', GLOB_
One solution might be to do this:
// initialize $images shuffle($images); $randomImage = array_pop($images); ?>
This will guarantee that you use each image only once, in a random order.