Last active
August 29, 2015 14:21
-
-
Save momota10s/8348cc2d5e4d786f9dc6 to your computer and use it in GitHub Desktop.
曜日を色付きで返すメソッド
This file contains 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 | |
/** | |
** 曜日を色付きで返す | |
*/ | |
public static function getDayOfWeek($date){ | |
$week = array("日", "月", "火", "水", "木", "金", "土"); | |
$w = date("w", strtotime($date)); | |
print($date); | |
if($w == 0){ | |
print("<FONT COLOR=\"RED\">(".$week[$w].")"); | |
}else if($w == 6){ | |
print("<FONT COLOR=\"BLUE\">(".$week[$w].")"); | |
}else{ | |
print("(".$week[$w].")"); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment