的index.php传递变量到一个包括
<?php
$title = "This is the page title";
require_once '/includes/header.php';
?>
的header.php
<head>
<title><?= $title ?></title>
</head>
输出
的index.php传递变量到一个包括
<?php
$title = "This is the page title";
require_once '/includes/header.php';
?>
的header.php
<head>
<title><?= $title ?></title>
</head>
输出
我觉得短标记可能没有启用。尝试:
<title><?php echo $title ?></title>
代替
是否在php.ini中启用了短标签?
我唯一的想法是,你必须在你的php.ini禁用短标签。
尝试以下操作:
<head>
<title><?php echo $title; ?></title>
</head>
詹姆斯C击败你10秒! – 2011-05-08 21:27:32
这不是一场比赛。 – 2011-05-09 14:26:48
您需要配置PHP为short_open_tag
就是这样。只要SO允许,我会立即作出回答。谢谢! – 2011-05-08 21:27:58