質問編集履歴

2

例を書き直しました。

2019/07/17 07:14

投稿

helloman
helloman

スコア39

test CHANGED
File without changes
test CHANGED
@@ -1,12 +1,30 @@
1
1
  ```php
2
2
 
3
- function page() {全体を処理}
4
3
 
5
- function content() {コンテンツを処理}
6
4
 
7
- function header() {ヘッダーを処理}
5
+ function page($page) {
8
6
 
7
+ return str_replace('あ', 'ああ', $page);
8
+
9
+ }
10
+
11
+ function content($content) {
12
+
13
+ return str_replace('い', 'いい', $content);
14
+
15
+ }
16
+
17
+ function header($header) {
18
+
19
+ return str_replace('う', 'うう', $header);
20
+
21
+ }
22
+
9
- function footer() {フッターを処理}
23
+ function footer($footer) {
24
+
25
+ return str_replace('え', 'ええ', $footer);
26
+
27
+ }
10
28
 
11
29
 
12
30
 
@@ -16,11 +34,11 @@
16
34
 
17
35
 
18
36
 
19
- ob_start('content');
37
+ ob_start('header');
20
38
 
39
+ ヘッダーの内容
21
40
 
22
-
23
- ob_start('header');
41
+ ヘッダーの内容
24
42
 
25
43
  ヘッダーの内容
26
44
 
@@ -32,11 +50,19 @@
32
50
 
33
51
  コンテンツの内容
34
52
 
53
+ コンテンツの内容
54
+
55
+ コンテンツの内容
56
+
35
57
  ob_end_flush(); // contentの終わり
36
58
 
37
59
 
38
60
 
39
61
  ob_start('footer');
62
+
63
+ フッターの内容
64
+
65
+ フッターの内容
40
66
 
41
67
  フッターの内容
42
68
 
@@ -46,7 +72,7 @@
46
72
 
47
73
  ob_end_flush(); // pageの終わり
48
74
 
49
- // コンテンツの最後
75
+
50
76
 
51
77
  ```
52
78
 

1

説明を追加しました

2019/07/17 07:14

投稿

helloman
helloman

スコア39

test CHANGED
File without changes
test CHANGED
@@ -1,50 +1,50 @@
1
1
  ```php
2
2
 
3
- functiom a() {...}
3
+ function page() {全体を処理}
4
4
 
5
- functiom b() {...}
5
+ function content() {コンテンツを処理}
6
6
 
7
- functiom c() {...}
7
+ function header() {ヘッダーを処理}
8
8
 
9
- functiom d() {...}
9
+ function footer() {フッターを処理}
10
10
 
11
11
 
12
12
 
13
13
  // コンテンツの最初
14
14
 
15
-
16
-
17
- ob_start('a');
15
+ ob_start('page');
18
16
 
19
17
 
20
18
 
21
- ob_start('b');
19
+ ob_start('content');
22
20
 
23
21
 
24
22
 
25
- ob_start('c');
23
+ ob_start('header');
26
24
 
27
- 〜色々な内容
25
+ ヘッダーの内容
28
26
 
29
- ob_end_flush(); // cの終わり
27
+ ob_end_flush(); // headerの終わり
30
28
 
31
29
 
32
30
 
33
- ob_start('d');
31
+ ob_start('content');
34
32
 
35
- 〜色々な内容
33
+ コンテンツの内容
36
34
 
37
- ob_end_flush(); // dの終わり
35
+ ob_end_flush(); // contentの終わり
38
36
 
39
37
 
40
38
 
39
+ ob_start('footer');
40
+
41
+ フッターの内容
42
+
41
- ob_end_flush(); // bの終わり
43
+ ob_end_flush(); // footerの終わり
42
44
 
43
45
 
44
46
 
45
- ob_end_flush(); // aの終わり
47
+ ob_end_flush(); // pageの終わり
46
-
47
-
48
48
 
49
49
  // コンテンツの最後
50
50