PHP-filename在不同的脚本上调用函数,从包含函数的脚本中获取文件名
fileA.php:需要function.inc.php并使用该包含文件中的PHP-filename在不同的脚本上调用函数,从包含函数的脚本中获取文件名,php,filenames,require,Php,Filenames,Require,fileA.php:需要function.inc.php并使用该包含文件中的x() fileB.php:需要fileA.php用户调用fileB.php获取fileA.php function.inc.php:function x()-返回调用它的文件名 PHP服务器变量或从function.inc.PHP中获取fileA.PHP名称的任何变量是什么 用例-函数x()可以是mysql\u query()或die(mail({关于错误的信息以及导致错误的文件)}) 根据以下答案-这是有效的:
x()
fileB.php:需要fileA.php用户调用fileB.php获取fileA.php
function.inc.php:function x()
-返回调用它的文件名
PHP服务器变量或从function.inc.PHP中获取fileA.PHP名称的任何变量是什么
- 用例-函数x()可以是
mysql\u query()或die(mail({关于错误的信息以及导致错误的文件)})
函数x($q){
mysql_查询($q)或死亡(邮件($q)yourself@example.com,error@.$\u SERVER['PHP\u SELF'],序列化(debug\u backtrace())。“\n\n”.mysql\u error());
}
- 对于投票反对的人-您能为上面的函数跟踪提供更好的想法/解决方案吗