$years = date("Y"); //用date()函式取得目前年份格式0000
$months = date("m"); //用date()函式取得目前月份格式00
$days = date("d"); //用date()函式取得目前日期格式00//
$day = date("Y-m-d",mktime(0,0,0,$months-10,$days,$years));
$lastday = date("Y-m",mktime(0,0,0,$months-1,$days,$years));
$afterday = date("Y-m",mktime(0,0,0,$months-2,$days,$years));