Skip to content

Instantly share code, notes, and snippets.

@momota10s
Created May 19, 2015 13:15
Show Gist options
  • Save momota10s/ac1a5d01ef56d0ec1a3a to your computer and use it in GitHub Desktop.
Save momota10s/ac1a5d01ef56d0ec1a3a to your computer and use it in GitHub Desktop.
休日の曜日の文字に色をつける
<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