从外部获取并在标题中回显



我不知道这是否可能。

我想调用一个外部页面并在下面像这样回声。

索引.php

<?php include 'extern/connect.php';
  $title = file_get_contents('extern/title.php');

 ?>
<head>
<title><?php echo $title; ?></title>       //here i want to echo also $a from title.php   
</head>

标题.php

<?php
$a ="Youtube";
$b ="Facebook";
$c ="Myspace";
$d ="Google";

?>

这可能吗?

感谢您的任何帮助

为什么不使用简单的包含?它将放置页面的内容并对其进行解释(就像您在索引顶部所做的一样.php)

最新更新