我有一个php include
声明为我的网站的“头”。PHP包含各种
我使用下面的代码来调用head.php
...
<?php
include '../components/head.php'
?>
在我head.php
我有以下代码...
<head>
<link rel="stylesheet" type="css" href="/style.css">
<title>Dummy Code</title>
</head>
我怎样才能使它改变标题通过在我的页面上显示一个变量,如Dummy Code | About
是我的网页上的$title = "About"
。
有没有办法做到这一点?
WAT?简单'
将变量$ title放入
您必须在包含'heaad.php'之前设置'$ title'' – Bugaloo