how to locate backward folder in php code example
Example 1: import file 3 directories back
//Current Directory
./index.js
//One Directory Up
../index.js
//Two Directories Up
../../index.js
Example 2: 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;
}