array ( 0 => 'index.php', 1 => 'PHP Manual', ), 'head' => array ( 0 => 'UTF-8', 1 => 'pt_BR', ), 'this' => array ( 0 => 'function.posix-getcwd.php', 1 => 'posix_getcwd', ), 'up' => array ( 0 => 'ref.posix.php', 1 => 'POSIX Funções', ), 'prev' => array ( 0 => 'function.posix-get-last-error.php', 1 => 'posix_get_last_error', ), 'next' => array ( 0 => 'function.posix-getegid.php', 1 => 'posix_getegid', ), 'alternatives' => array ( ), 'source' => array ( 'lang' => 'en', 'path' => 'reference/posix/functions/posix-getcwd.xml', ), ); $setup["toc"] = $TOC; $setup["toc_deprecated"] = $TOC_DEPRECATED; $setup["parents"] = $PARENTS; manual_setup($setup); ?>
(PHP 4, PHP 5, PHP 7, PHP 8)
posix_getcwd — Pathname of current directory
Gets the absolute pathname of the script's current working directory. On error, it sets errno which can be checked using posix_get_last_error()
Esta função não possui parâmetros.
Returns a string of the absolute pathname on success.
On error, returns false
and sets errno which can be checked with
posix_get_last_error().
Exemplo #1 posix_getcwd() example
This example will return the absolute path of the current working directory of the script.
<?php
echo 'My current working directory is '.posix_getcwd();
?>
Nota:
This function can fail on
- Read or Search permission was denied
- Pathname no longer exists