<?php
$dayofyear = date('z');
// test it
echo 'Today is day number ' . $dayofyear ;
?>
<img src="/images/<?php echo $dayofyear ?>.jpg" />
Gives:
Today is day number 17
<img src=“/images/17.jpg” />
Now, when it becomes slightly trickier is when:
The images are not all .jpg
The images are different sizes and you want to tell the browser height= width=
The images are different sizes and you want to resise them
You want meaningful alt texts to accompany each image
But if its just a 366 day image rotator you want … it really is that simple.