Answers for "php current file location"

PHP
4

php current file name

basename(__FILE__, '.php');
Posted by: Guest on March-06-2020
-1

php get file location

# C:\Users\Redacted\Desktop\main.php
include __DIR__ . DIRECTORY_SEPARATOR . 'include.php';
echoScriptPath();

# C:\Users\Redacted\Desktop\include.php
function echoScriptPath() {
    list($scriptPath) = get_included_files();
    echo 'The script being executed is ' . $scriptPath;
}
Posted by: Guest on June-19-2020

Code answers related to "php current file location"

Browse Popular Code Answers by Language