I am trying to figure out the best way, using PHP, to pull a random image from multiple sub-folders on my site. I would use the RecursiveDirectoryIterator to iterate through the subfolders and extract images, but am wondering how to handle the randomisation and how to do it efficiently. Any advice on how to go about this?