日历程序
<? 

Header
"Content-type: image/gif"); 

$im ImageCreate(156142); 
$black ImageColorAllocate($im505050); 
$white ImageColorAllocate($im255255255); 
$orange ImageColorAllocate($im2552000); 
$yellow ImageColorAllocate($im2552550); 
$tan ImageColorAllocate($im255255190); 
$grey ImageColorAllocate($im205205205); 
$dkgrey ImageColorAllocate($im140140140); 

ImageRectangle($im11155141$dkgrey); 
ImageRectangle($im12215539$dkgrey); 
ImageRectangle($im15615573$dkgrey); 
ImageRectangle($im190155107$dkgrey); 
ImageRectangle($im1107155124$dkgrey); 
ImageRectangle($im232245141$dkgrey); 
ImageRectangle($im672289141$dkgrey); 
ImageRectangle($im11122133141$dkgrey); 

ImageRectangle($im00154140$white); 
ImageRectangle($im02115438$white); 
ImageRectangle($im05515472$white); 
ImageRectangle($im089154106$white); 
ImageRectangle($im0106154123$white); 
ImageRectangle($im222144140$white); 
ImageRectangle($im662188140$white); 
ImageRectangle($im11021132140$white); 




$today date"d"); 
$month date"m"); 
$year date"Y"); 
$datecode date"Ymd"); 
$gif '.gif'
$first=mktime(0,0,0,$month,1,$year); 

$mon_yr=date"F Y"$first); 

$wd=date"w",$first); 
$lastday=date"d",mktime(0,0,0,$month+1,0,$year)); 
$cur=-$wd+0
$ver_position 50
for (
$k=0;$k<6;$k++) { 
$day_position 5
$last_row_used 0
for (
$i=0;$i<7;$i++ ) { 
$cur++; 
$sing_add 0
if ((
$cur<=0) || ($cur>$lastday) ) $day_position = ($day_position 22); 
else 

$day_color $grey
if (
$day_position<10$day_color $tan
if (
$cur==$today$day_color $yellow

if (
strlen($cur)<2) {$sing_add 4;} 
$fin_position = ($day_position $sing_add); 

ImageTTFText($im120$fin_position$ver_position$day_color"./fonts/arialbd.ttf""$cur"); 

$day_position = ($day_position 22); 
$last_row_used 1


$day_position 5
if (
$last_row_used$ver_position = ($ver_position 17); 

$spc 23
$st_add 0
$st "$mon_yr"
$st_len strlen($st); 
$st_margin = (14 $st_len); 
if (
$st_margin 0) {$st_add = ($st_margin 4);} 
$spc = ($spc $st_add); 
ImageTTFText($im140$spc15$white"./fonts/arialbd.ttf""$st"); 

ImageString($im2323"Sun"$orange); 
ImageString($im22523"Mon"$orange); 
ImageString($im24723"Tue"$orange); 
ImageString($im26923"Wed"$orange); 
ImageString($im29123"Thu"$orange); 
ImageString($im211323"Fri"$orange); 
ImageString($im213523"Sat"$orange); 

if (
$ver_position<140

$im_out ImageCreate(156125); 
$out_black ImageColorAllocate($im_out505050); 
ImageRectangle($im1124155124$dkgrey); 
ImageCopyResized($im_out$im0000156125156125); 
ImageColorTransparent($im_out$out_black); 
ImageGIF($im_out"./dategif/$datecode$gif"); 
ImageGIF($im_out); 
ImageDestroy($im); 
ImageDestroy($im_out); 

?>