質問編集履歴
2
例を書き直しました。
title
CHANGED
File without changes
|
body
CHANGED
@@ -1,28 +1,41 @@
|
|
1
1
|
```php
|
2
|
-
function page() {全体を処理}
|
3
|
-
function content() {コンテンツを処理}
|
4
|
-
function header() {ヘッダーを処理}
|
5
|
-
function footer() {フッターを処理}
|
6
2
|
|
3
|
+
function page($page) {
|
4
|
+
return str_replace('あ', 'ああ', $page);
|
5
|
+
}
|
6
|
+
function content($content) {
|
7
|
+
return str_replace('い', 'いい', $content);
|
8
|
+
}
|
9
|
+
function header($header) {
|
10
|
+
return str_replace('う', 'うう', $header);
|
11
|
+
}
|
12
|
+
function footer($footer) {
|
13
|
+
return str_replace('え', 'ええ', $footer);
|
14
|
+
}
|
15
|
+
|
7
16
|
// コンテンツの最初
|
8
17
|
ob_start('page');
|
9
18
|
|
10
|
-
ob_start('content');
|
11
|
-
|
12
19
|
ob_start('header');
|
13
20
|
ヘッダーの内容
|
21
|
+
ヘッダーの内容
|
22
|
+
ヘッダーの内容
|
14
23
|
ob_end_flush(); // headerの終わり
|
15
24
|
|
16
25
|
ob_start('content');
|
17
26
|
コンテンツの内容
|
27
|
+
コンテンツの内容
|
28
|
+
コンテンツの内容
|
18
29
|
ob_end_flush(); // contentの終わり
|
19
30
|
|
20
31
|
ob_start('footer');
|
21
32
|
フッターの内容
|
33
|
+
フッターの内容
|
34
|
+
フッターの内容
|
22
35
|
ob_end_flush(); // footerの終わり
|
23
36
|
|
24
37
|
ob_end_flush(); // pageの終わり
|
25
|
-
|
38
|
+
|
26
39
|
```
|
27
40
|
|
28
41
|
みたいなことをしたいのですが、
|
1
説明を追加しました
title
CHANGED
File without changes
|
body
CHANGED
@@ -1,27 +1,27 @@
|
|
1
1
|
```php
|
2
|
-
|
2
|
+
function page() {全体を処理}
|
3
|
-
functiom b() {...}
|
4
|
-
|
3
|
+
function content() {コンテンツを処理}
|
5
|
-
|
4
|
+
function header() {ヘッダーを処理}
|
5
|
+
function footer() {フッターを処理}
|
6
6
|
|
7
7
|
// コンテンツの最初
|
8
|
+
ob_start('page');
|
8
9
|
|
9
|
-
ob_start('
|
10
|
+
ob_start('content');
|
10
11
|
|
11
|
-
ob_start('
|
12
|
+
ob_start('header');
|
13
|
+
ヘッダーの内容
|
14
|
+
ob_end_flush(); // headerの終わり
|
12
15
|
|
13
|
-
ob_start('
|
16
|
+
ob_start('content');
|
14
|
-
|
17
|
+
コンテンツの内容
|
15
|
-
ob_end_flush(); //
|
18
|
+
ob_end_flush(); // contentの終わり
|
16
19
|
|
17
|
-
ob_start('
|
20
|
+
ob_start('footer');
|
18
|
-
|
21
|
+
フッターの内容
|
19
|
-
ob_end_flush(); //
|
22
|
+
ob_end_flush(); // footerの終わり
|
20
23
|
|
21
|
-
ob_end_flush(); // bの終わり
|
22
|
-
|
23
|
-
ob_end_flush(); //
|
24
|
+
ob_end_flush(); // pageの終わり
|
24
|
-
|
25
25
|
// コンテンツの最後
|
26
26
|
```
|
27
27
|
|