我試圖通過php獲取當前,下個月和下個月後。PHP得到下個月的問題
這是我目前的PHP:
setlocale(LC_TIME, "de_DE.utf8");
$thismonth = strftime("%B");
$nextmonth = strftime('%B', strtotime('+1 month', mktime(0, 0, 0, $month, 1, $year)));
$overnextmonth = strftime('%B', strtotime('+2 month', mktime(0, 0, 0, $month, 1, $year)));
月份名稱應該是德國人,所以我用setlocale(LC_TIME, "de_DE.utf8");
。輸出是:Januar(一月),Januar(一月),Februar(二月)。我無法解決這個問題。
檢查了這一點。 http://stackoverflow.com/questions/21661218/php-cant-get-date-in-german-language –
注意:未定義的變量:month in ...... – RiggsFolly
'$ month'和'$年'來自 – RiggsFolly