-1
年がフォームから提出される特定の年の月のリストを取得したい。月には、開始日とその月の最終日が含まれていなければなりません。特定の年の月のリストを開始日と最後の日付で取得する
$year = $_POST['year'];
$current_year = date('Y');
for ($m=1;$m<=12;$m++)
{$month = date("F", mktime(0,0,0,$m,1,$year));
$nmonth = date("m",strtotime($month));
$days = cal_days_in_month(CAL_GREGORIAN,$nmonth,$year);
$sdate = mktime(0, 0, 0, $nmonth, 1, $year);
$edate = mktime(0, 0, 0, $nmonth, $days, $year);
//$edate = date("Y-m-t", strtotime($sdate));
echo strftime("$month $year").' - '.'Start date '.''.strftime(" %Y-%m-%d", $sdate).' '.'End date '.''.$edate.' - '.strtoupper(substr($month, 0, 3)).date("y",mktime(0,0,0,$nmonth,1,$year)).$days.'<br>';
//echo $month.' '.$days.' '.$sdate.' '.$edate.'<br>';
}
<body>
<form id="period" name="period" method="post" action="create_period.php">
<input type="text" name="year" id="year" />
<label>
<input type="submit" name="button" id="submit" value="Create Period" />
</label>
<input type="hidden" name="id" id="id" />
</form>
</body>
ありがとう@のイスマイル・rbouh。あなたは天才です – user3315848
私は助けに感謝します。私は別の問題が[リンク](http://stackoverflow.com/questions/38684317/values-fail-to-insert-when-into-table-fields-when-posted) – user3315848