我有一個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