这是否可以将其他PHP代码存储在变量中。 我正在尝试从后端创建php页面,就像在CMS中一样
$var = include 'page.php' . "
php code start
$code = include 'bootstrap.php' . "
// header code
php code
}
// footer code
";
$menu_alias = "newHTMLFileName";
$path= "../folder".$menu_alias.".php";
if (!file_exists ($path))
{
$handle = fopen ($path, "w");
$write = fwrite ($handle, $code);
fclose($handle);
echo "created";
}
else
{
echo "already created";
}
我想知道是否可以编写PHP代码和MySQL查询并将它们存储到变量中。 提前致谢