【发布时间】:2013-06-23 19:41:39
【问题描述】:
我的网站“负责人”有一个php include 声明。
我正在使用以下代码调用head.php...
<?php
include '../components/head.php'
?>
在我的head.php 中,我有以下代码...
<head>
<link rel="stylesheet" type="css" href="/style.css">
<title>Dummy Code</title>
</head>
如果我的网页上有$title = "About",我如何通过在我的页面上使用一个变量来更改标题,例如Dummy Code | About 作为标题。
有没有办法做到这一点?
【问题讨论】:
-
看?简单
<title>My site - <?php echo $title;?></title>? -
把变量$title放在
标签中 -
必须在包含
heaad.php之前设置$title