我有一个 PHP 页面 (content.php),其中包含由 PHP 变量传递的纯 HTML 和内容
<html>
<head>
</head>
<body>
<h1><?php echo $title; ?></h1>
</body>
</html>
然后是另一个 PHP 页面,我需要在字符串中包含 content.php 的内容,但已经由 PHP 解析器处理。我已经尝试了 file_get_contents() 函数,但这给出了原始输出(未处理 PHP)。我正在寻找的是:
$var contents = somefunction('contents.php')
内容:
<html>
<head>
</head>
<body>
<h1>Title</h1>
</body>
</html>
非常感谢任何帮助!