我有一个这样的函数
function test()
{
include("test.php");
}
echo test();
test.php
<?php
//echo 'test1';
return 'test2';
?>
echo 'test1'
工作,但return 'test2'
不工作。
for me不返回任何值。
是的,这是可能的,但是您还需要从函数返回该值:
function test()
{
return include("test.php");
}
echo test();