What is getcwd in PHP?
getcwd is a PHP function that returns the current directory in which the program is being run.
Syntax
getcwd(): string|false
Parameters
The function does not take any parameters.
Return value
If successful, the function returns the current working directory. Otherwise, it returns false.
Code
<?php// prints the current directoryecho getcwd() . "\n";?>
Expected output
/home/educative