获取包含文件中当前PHP脚本的名称 [英] get name of current PHP script in include file

查看:97
本文介绍了获取包含文件中当前PHP脚本的名称的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有这样提供的文件:

AJAX请求处理程序->包含文件

AJAX request handler -> Include file

我想在包含本身中检索包含文件的名称. $_SERVER['PHP_SELF']$_SERVER['SCRIPT_NAME']都不适合此操作,因为它们返回父"脚本名称.

I would like to retrieve the name of the include file within the include itself. Neither $_SERVER['PHP_SELF'] or $_SERVER['SCRIPT_NAME'] is suitable for this, as they return the "parent" script name.

谢谢.

推荐答案

__FILE__

http://us3.php.net/manual/zh/language.constants.predefined.php

这篇关于获取包含文件中当前PHP脚本的名称的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆