回答編集履歴

3

modify

2018/04/17 12:56

投稿

退会済みユーザー
test CHANGED
@@ -74,7 +74,7 @@
74
74
 
75
75
  $youbi = $wkanji[$ww]; //配列から日本語の曜日に変換
76
76
 
77
- $go_toh_bi = ($d % 5 == 0 || $d == $lastday)? "go_toh_bi " : "";
77
+ $go_toh_bi = ($d % 5 == 0 || $d == $lastday)? "go_toh_bi " : "";
78
78
 
79
79
  echo "<span class='{$go_toh_bi}day_of_week_{$ww}'>{$d}日({$youbi})</span><br>";
80
80
 

2

modify

2018/04/17 12:56

投稿

退会済みユーザー
test CHANGED
@@ -60,7 +60,7 @@
60
60
 
61
61
 
62
62
 
63
- When you want to emphasize the day 5, 10, 15, 20, 25 and last day of the month, you could write code using multiple classes those are separated with whitespace space like below.
63
+ When you want to emphasize the day 5, 10, 15, 20, 25 and last day of the month, you could write code using multiple classes those are separated with whitespace like below.
64
64
 
65
65
 
66
66
 

1

modify

2018/04/17 12:54

投稿

退会済みユーザー
test CHANGED
@@ -53,3 +53,71 @@
53
53
    :
54
54
 
55
55
  ```
56
+
57
+
58
+
59
+ #### Addition:
60
+
61
+
62
+
63
+ When you want to emphasize the day 5, 10, 15, 20, 25 and last day of the month, you could write code using multiple classes those are separated with whitespace space like below.
64
+
65
+
66
+
67
+ ```PHP
68
+
69
+ for($d = 1; $d <= $lastday; $d++)
70
+
71
+ {
72
+
73
+ $ww = date("w", mktime(0, 0, 0, $month, $d, $year)); //曜日対応付けの数字を算出
74
+
75
+ $youbi = $wkanji[$ww]; //配列から日本語の曜日に変換
76
+
77
+ $go_toh_bi = ($d % 5 == 0 || $d == $lastday)? "go_toh_bi " : "";
78
+
79
+ echo "<span class='{$go_toh_bi}day_of_week_{$ww}'>{$d}日({$youbi})</span><br>";
80
+
81
+ }
82
+
83
+ ```
84
+
85
+
86
+
87
+ ```HTML
88
+
89
+ <!DOCTYPE html>
90
+
91
+ <html lang="ja">
92
+
93
+ <head>
94
+
95
+ <meta charset="utf-8">
96
+
97
+ <title>ページのタイトル</title>
98
+
99
+
100
+
101
+ <style>
102
+
103
+ span.day_of_week_0 { color: red; } /* Sunday */
104
+
105
+ span.day_of_week_6 { color: blue; } /* Saturday */
106
+
107
+ span.go_toh_bi { font-weight: bold; } /* go toh bi */
108
+
109
+ </style>
110
+
111
+
112
+
113
+ </head>
114
+
115
+ <body>
116
+
117
+   :
118
+
119
+ ```
120
+
121
+
122
+
123
+ This case study will teach us that the computer programming code will be more simpler when using some classes than not using it.