我的代码看起来像:
index.php:
<html>....
<title>My page</title>
....
<?php
switch ($_GET['id']){
case "tips":
include("tips.php");
$title = "Tips";
...
Run Code Online (Sandbox Code Playgroud)
如何获得html title标签的标题变量?
所有页面都通过index.php.
Sam*_*son 10
在HTML输出之前执行PHP.
<?php
switch ($_GET["id"]) {
case "tips":
$title = "Tips";
$page = "tips.php";
}
?>
<html>
<head>
<title><?php print $title; ?></title>
</head>
<body>
<?php include($page); ?>
</body>
</html>
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
5661 次 |
| 最近记录: |