Created
May 19, 2015 13:15
-
-
Save momota10s/ac1a5d01ef56d0ec1a3a 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
<html> | |
<?php $week = array("日", "月", "火", "水", "木", "金", "土"); ?> | |
<?php $w = date("w", strtotime($date)); ?> | |
<?php if($w == 0): ?> | |
<p><?php echo $date; ?><font color="#ff0000">(<?php echo $week[$w]; ?>)</p> | |
<?php elseif($w == 6): ?> | |
<p><?php echo $date; ?><font color="#0000ff">(<?php echo $week[$w]; ?>)</p> | |
<?php else: ?> | |
<p><?php echo $date; ?>(<?php echo $week[$w]; ?>)</p> | |
<?php endif;?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment