效果:
http://yuec.atwebpages.com为什么总错一天?在本地测试没问题啊
function gaokao()
{
date_default_timezone_set("PRC");
if(file_exists('gaokao/tmp/time.png'))
{
unlink('gaokao/tmp/time.png');
}
$date = date("Y-m-d");
echo $date;
list($eyear,$emonth,$eday) = explode('-',$date);
$start = mktime(0,0,0,$emonth,$eday,$eyear);
$end = mktime(0,0,0,6,7,2013);
$days = round(($end -$start)/86400);
$img = imagecreatefrompng("gaokao/time.png");
$red = ImageColorAllocate($img,255,0,0);
$green = ImageColorAllocate($img,0,255,0);
$title = $date.' TO 2013-06-07';
echo $title;
imagettftext($img,6,0,9,20,$green,"gaokao/font/e.ttf",$title);
imagettftext($img,36,0,30,87,$red,"gaokao/font/e.ttf",$days);
imagepng($img,"gaokao/tmp/time.png",8);
ImageDestroy($img);
return true;
}
求解,,,