Created
June 10, 2012 05:50
-
-
Save toshimaru/2904021 to your computer and use it in GitHub Desktop.
output this week days.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$sunt = mktime(0, 0, 0, date("m"), date("d")-date("w"), date("Y")); // 今週の日曜日0時の時刻 | |
for ($i = 0; $i < 7; $i++) { | |
$t = $sunt + $i * 60 * 60 * 24; //ワンステップで一日 | |
$day = date("j", $t); | |
if ($day == date("j")) { //今日の場合 | |
$day = "<b>{$day}</b>"; | |
} | |
echo " <td>{$day}</td>\n"; | |
} | |
/* | |
output: | |
27 28 29 30 1 2 3 | |
*/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment