Starting January 1, 2000, "Three days fishing, two days" count, for any day to fight fishing or drying nets?
Starting January 1, 2000, "Three days fishing, two days" count, for any day to fight fishing or drying nets?
------Solution--------------------
PHP Code
------Solution--------------------
Write a function.
PHP Code
function GetText ($day) { $nowDay = date ("Z", Strtotime ($day)) + 1; Return ($nowDay%5 >= 1 && $nowDay%5 <=3)? ' Sun nets ': ' Fishing ';} echo GetText (' 2011-01-01 ');
------Solution--------------------
The calculation is not allowed because the number of days difference calculation error
Give the most stupid method for your reference. Aren't you doing your homework?
$t = Strtotime (' 2000-1-1 ');
$i = 0;
while ($t < time ()) {
echo Date (' y-m-d ', $t). ' '. ($i < 3? ' Fishing ': ' Sun net '). Php_eol;
$t = Strtotime (' +1 Day ', $t);
$i = ($i + 1)% 5;
}