How to get one random image from ten thousand folders using glob?

I have thousand directory folders like this:

img/monkey-folder/ cute-monkey.jpg etc. etc
img/turkey-folder/
img/rose-folder/
img/big-fish-folder/
img/more-folder/
etc.

Each folder has 20 images.

How to get only 1 random image?

This code below is working but only pull 1 image from 1 folder. I need one random image from multiple folders. thanks

<?php
$imagesDir = 'img/monkey-folder/';
$images = glob($imagesDir . '*.{jpg,jpeg,png,gif}', GLOB_BRACE);
$randomImage =...
Code (markup):
How to get one random image from ten thousand folders using glob?

from PHP http://ift.tt/1UmiRlj
via IFTTT
Previous
Next Post »
Thanks for your comment