Passing variable to an include
index.php
<?php
$title = "This is the page title";
require_once '/includes/header.php';
?>
header.php
<head>
<title><?= $title ?></title>
</head>
Ou开发者_运维问答tput
I think short tags may not be enabled. Try:
<title><?php echo $title ?></title>
instead
did you enable short tags in php.ini?
short link
My only thought is that you have short tags disabled in your php.ini.
Try the following:
<head>
<title><?php echo $title; ?></title>
</head>
You need to configure your PHP for short_open_tag
精彩评论