开发者

PHP - retrieve name of script that included or required it

开发者 https://www.devze.com 2023-01-08 01:44 出处:网络
Ho开发者_如何学运维w do you retrieve the name of the script that included or required it? Example:

Ho开发者_如何学运维w do you retrieve the name of the script that included or required it?

Example: script login.php has a require_once('validate.php') ... validate.php is also called by a number of other scripts. Other than manually setting a flag, is there a way to have validate.php know which script is including/requiring it?


Try $_SERVER['SCRIPT_NAME'];

More here: http://php.net/manual/en/reserved.variables.server.php

0

精彩评论

暂无评论...
验证码 换一张
取 消