function.showfile.php内容
<?php
function show_file(){
return __FILE__;
}
echo show_file()."<br />";
?>
test.php内容
<?php
require_once('showfile.php');
echo show_file()."<br />";
?>
index.php内容
<?php
require_once('test.php');
echo show_file()."<br />";
?>
需要的结果是各自的文件名路径,如:
C:\www\test\function.showfile.php
C:\www\test\test.php
C:\www\test\index.php
而不是下面的结果
C:\www\test\index.php
C:\www\test\index.php
C:\www\test\index.php
请问该如何改下面的函数?
function show_file(){
return __FILE__;
}