回答編集履歴
2
調整
test
CHANGED
@@ -19,3 +19,33 @@
|
|
19
19
|
</div>
|
20
20
|
|
21
21
|
```
|
22
|
+
|
23
|
+
|
24
|
+
|
25
|
+
# デフォルト値指定
|
26
|
+
|
27
|
+
|
28
|
+
|
29
|
+
```PHP
|
30
|
+
|
31
|
+
<?PHP
|
32
|
+
|
33
|
+
$cookie=filter_var_array($_COOKIE,["title"=>FILTER_DEFAULT]);
|
34
|
+
|
35
|
+
$title=(!is_null($cookie["title"]) and $cookie["title"]!=="")?$cookie["title"]:"title1";
|
36
|
+
|
37
|
+
$class=["title1"=>"","title2"=>""];
|
38
|
+
|
39
|
+
$class[$title]=" class=\"current\"";
|
40
|
+
|
41
|
+
?>
|
42
|
+
|
43
|
+
<div class="PageTitle">
|
44
|
+
|
45
|
+
<h1 id="title1"<?=$class["title1"];?>>title1</h1>
|
46
|
+
|
47
|
+
<h1 id="title2"<?=$class["title2"];?>>title2</h1>
|
48
|
+
|
49
|
+
</div>
|
50
|
+
|
51
|
+
```
|
1
そーす
test
CHANGED
@@ -1,3 +1,5 @@
|
|
1
|
+
```PHP
|
2
|
+
|
1
3
|
<?PHP
|
2
4
|
|
3
5
|
$cookie=filter_var_array($_COOKIE,["title"=>FILTER_DEFAULT]);
|
@@ -15,3 +17,5 @@
|
|
15
17
|
<h1 id="title2"<?=$class["title2"];?>>title2</h1>
|
16
18
|
|
17
19
|
</div>
|
20
|
+
|
21
|
+
```
|