私はPHPで関数を作成しようとしていますが、日付によってはそれが得られます
今週(月日)20/8/12から26/8/12
次の週+1(月日)27/8/12から02/9/12
次の週+2(月日)03/9/12から09/9/12
次の週+3(月日)
次の週+4(月日)
次の週+5(月日)
以下を使ってみましたが、もっときれいなものはありますか?
$week0_mon = date("Y-m-d", strtotime(date("Y").'W'.date('W')."1"));
$week0_sun = date("Y-m-d", strtotime(date("Y").'W'.date('W')."7"));
$week1_mon = date("Y-m-d", strtotime(date("Y-m-d", strtotime($week0_mon)) . " +1 week"));
$week1_sun = date("Y-m-d", strtotime(date("Y-m-d", strtotime($week0_sun)) . " +1 week"));
echo $week0_mon.' to '.$week0_sun.'<br />';
echo $week1_mon.' to '.$week1_sun.'<br />';