PHP - retrieve name of script that included or required it

前端 未结 1 1660
别跟我提以往
别跟我提以往 2020-12-20 03:27

How 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 cal

相关标签:
1条回答
  • 2020-12-20 03:58

    Try $_SERVER['SCRIPT_NAME'];

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

    0 讨论(0)
提交回复
热议问题