Tuesday, 5 May 2009

PHP to Change Background Based on the Day of the Year

This PHP will change the background image based on the day of the year.

It expects there to be 366 images to change to called 001.jpg, 002.jpg ... 366.jpg.


<body style="background-image: url(<?php echo str_pad(date(z),3,'0'); ?>.jpg)">



To change the background using Javascript see here


No comments: