To find the current working directory, use getcwd().
PHP getcwd() function has the following syntax.
getcwd();
getcwd() returns true on success or false on failure.
Get current working directory
<?PHP
$original_dir = getcwd();
print($original_dir);
?>
The code above generates the following result.