Help us understand the problem. What is going on with this article?

2月がカレンダーに4行7列ですっぽりハマる年を求めるスクリプト

More than 5 years have passed since last update.

2月1日が月曜日で かつ 28日までの(うるう年ではない) 年を探す

<?php
$year_list = array();
for ($y = 0; $y < 3000; $y++) {
    // 2月1日の曜日と うるう年かどうかを取得
    list($w, $L) = str_split(date('wL', strtotime("$y-2-1")));
    if (!$L && $w == 0) {
        $year_list[] = $y;
    }
}
echo implode(', ', $year_list);
Why not register and get more from Qiita?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away