Home | Scripts | Tutorials | Books | Hosting | Forums | Links|

Navigation:

Home
Source code
Tutorials
RSS feeds
Articles
Wordpress plugins
Blog
Books
Software
Downloads
Hosting
manuals
Script directory
Training
Our Links






 
 

SPONSORS



 
 

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: