Display the year graphically
This is a simple variation on the month example but this time we will display the year . The images are in the images dirctory and are numbered from 0.gif to 9.gif .
Code :
<?php
//our image directory
$images = "./images";
//store the year in $year
$year = date("Y");
//generate our graphics
for($i=0; $i< strlen($year);$i++)
{
$imagesrc = $images ."/" . substr($year , $i , 1) . ".gif";
$imagehtml .= "<img src = \"$imagesrc\" border=\"0\">";
}
//display the graphical year
echo "$imagehtml";
?>
Example:


