I have a PHP file that randomly generates an image from a folder on every refresh. I downloaded it from here (which also has an explanation).
Instead of randomly choosing images, how can I have it change the image hourly? For example, I would like it have the same image for an hour, and then change when that hour is up. Basically, a new image based on some time interval.
Thanks for the help.
Find line
$imageNumber = time() % count($fileList);And replace it with
$imageNumber = (date(z) * 24 + date(G)) % count($fileList);That should work for you.