PHP检测函数所在的文件名
ReflectionFunction类,可以获取指定函数所在PHP脚本中的具体位置。
创建引用脚本。
// Filename: functions.php
<?php
function now() {
return time();
}
?>
调用函数。
// Filename: call_now.php
<?php
require 'functions.php';
Reflection::export(new ReflectionFunction('now'));
// Function [ function now ] { @@ H:\www\functions.php 2 - 4 }
?>
现在还没有评论