输入banner图图片脚本导航/分类

PHP检测函数所在的文件名

很简单的功能,用到PHP中的反射机制,具体使用的是ReflectionFunction类,可以获取指定函数所在PHP脚本中的具体位置。 创建引用脚本。

Php代码

// Filename: functions.php   
<?php  
function now() {  
    return time();  
}  
?>

调用函数。

Php代码

// Filename: call_now.php  
<?php  
require 'functions.php';  
   
Reflection::export(new ReflectionFunction('now'));  
// Function [ function now ] { @@ H:\www\functions.php 2 - 4 }  
?>