Hey guys,
I'm stumped, I'm trying to pull in a (as in 1) random image from a dir each time the page loads, I have that part down, but what I am having problems with is, if there are only 5 or so images in the folder, you have a 1 in 5 chance that the same image will get displayed twice. How can I keep this from happening?
header("Content-type: image/jpeg"); $img = glob('images/*.{jpg,jpeg,png,gif}', GLOB_BRACE); $img = $img[array_rand($img)]; imagejpeg(imagecreatefromjpeg($img));