我想要/包含一个文件并将其内容检索到一个变量中.
test.php的
<?php
echo "seconds passed since 01-01-1970 00:00 GMT is ".time();
?>
Run Code Online (Sandbox Code Playgroud)
的index.php
<?php
$test=require("test.php");
echo "the content of test.php is:<hr>".$test;
?>
Run Code Online (Sandbox Code Playgroud)
喜欢file_get_contents()但它应该仍然执行PHP代码.这可能吗?
php ×1