如何在include之后向header添加内容?

时间:2014-08-01 22:42:56

标签: php class

我需要用这两个文件存档这样的东西:

文件1:header.php

<!doctype>
....
<title>$title</title>
...

文件2:body.php

include("header.php");
$title = "Hello! My tittle"

所以我想要的是:

结果:include()+ body()

<!doctype>
....
<title>Hello! My tittle</title>
...

我明白了:

<!doctype>
....
<title></title>
...

我该怎么做?可能吗?感谢

1 个答案:

答案 0 :(得分:0)

你正在撤销订单。在include之前设置$title

$title = "Hello! My tittle";
include("header.php");