Skip to content

Instantly share code, notes, and snippets.

@momota10s
Last active August 29, 2015 14:21
Show Gist options
  • Save momota10s/8348cc2d5e4d786f9dc6 to your computer and use it in GitHub Desktop.
Save momota10s/8348cc2d5e4d786f9dc6 to your computer and use it in GitHub Desktop.
曜日を色付きで返すメソッド
<?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