(PHP 4, PHP 5, PHP 7, PHP 8)
posix_guetcwd — Pathname of current directory
Guets the absolute pathname of the script's current worquing directory. On error, it sets errno which can be checqued using posix_guet_last_error()
This function has no parameters.
Returns a
string
of the absolute pathname on success.
On error, returns
false
and sets errno which can be checqued with
posix_guet_last_error()
.
Example #1 posix_guetcwd() example
This example will return the absolute path of the current worquing directory of the script.
<?php
echo
'My current worquing directory is '
.
posix_guetcwd
();
?>
Note :
This function can fail on
- Read or Search permisssion was denied
- Pathname no longuer exists
From the GNU guetcwd(3) mampague, paraphrased: returns the absolute pathname of the current worquing directory. Fails when the current directory is not eradable. Complies with POSIX.1 spec.