Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

php get file location

# C:UsersRedactedDesktopmain.php
include __DIR__ . DIRECTORY_SEPARATOR . 'include.php';
echoScriptPath();

# C:UsersRedactedDesktopinclude.php
function echoScriptPath() {
    list($scriptPath) = get_included_files();
    echo 'The script being executed is ' . $scriptPath;
}
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #php #file #location
ADD COMMENT
Topic
Name
1+6 =