We need a PHP that gets the number of items from a directory gets the day of the year and gets the reminder from day of the year % number of files. We'll add 1 to this value and pick the file from the directory that starts with the given number.
Important notes:
All files must start with a number followed by minus (-).
Files could have various extensions (gif, jpg, png...)
We'll deliver the given file as response. The page will make a link like this for us:
<img src="our_file.php" alt="Joke of the day" />
We need a PHP that gets the number of items from a directory gets the day of the year and gets the reminder from day of the year % number of files. We'll add 1 to this value and pick the file from the directory that starts with the given number. Important notes:
We'll deliver the given file as response. The page will make a link like this for us:
<img src="our_file.php" alt="Joke of the day" />