私は週刊誌を簡単に作成しようとしています。ここに私のコードは次のとおりです。php前の翌週選択した日付に基づいて
$daterange = new DatePeriod(
new DateTime('2016-04-08'),
new DateInterval('P1D'),
new DateTime(date('Y-m-d',strtotime ('1 week' , strtotime ('2016-04-08'))))
);
そして、単純なループ:完全に正常に動作しますが、私は必要なのから始まる日付を表示することです
08 - Fri
09 - Sat
10 - Sun
11 - Mon
12 - Tue
13 - Wed
14 - Thu
:
foreach ($daterange as $k => $row) {
echo $row->format('d') ." - " . $row->format('D') . "<br>";
}
のようなものを作成します日曜日または月曜日、週の最初の曜日に基づいています。望ましい結果は次のようになります。
10 - Sun
11 - Mon
12 - Tue
13 - Wed
14 - Thu
15 - Fri
16 - Sat
を「非整形式の数値が遭遇した」取得しています完璧。ありがとうございました。 – Alko