PHP预定义常量
走了点弯路,原来可以这么简单就做到,参阅PHP预定义常量。
[code]
class test {
function test_function() {
return __FUNCTION__;
}
function test_class() {
return __CLASS__;
}
function test_method() {
return __METHOD__;
}
}
echo "当前行号: ".__LINE__."
“;
echo “当前文件的完整路径: “.__FILE__.”
“;
echo “当前执行的类: “.test::test_class().”
“;
echo “当前执行的函数: “.test::test_function().”
“;
echo “当前类的方法名: “.test::test_method().”
“;
?>[/code]
输出结果:
当前行号: 14
当前文件的完整路径: E:\item_1\webmaster\test.php
当前执行的类: test
当前执行的函数: test_function
当前类的方法名: test::test_method

10月 16th, 2006 at 03:32:10
报告。你这里被挂马了。
10月 28th, 2006 at 09:57:40
keyi