Get current folder path in PHP
php get directory
$currentDirectoryName = basename(__DIR__);
echo 'Currently in the '.$currentDirectoryName .' directory <br><br>';
$fullPath = dir(getcwd());
echo 'The full path is: ' . $fullPath->path . '<br>';
PHP Get name of current directory
$myVar = current_directory_name;