PHP function getcwd()

Availability in PHP 4.0

Gets the current working directory

Parameters

The function has no input parameters.

Return values

string

the current working directory on success, or false on failure.

On some Unix variants, getcwd will return false if any one of the parent directories does not have the readable or search mode set, even if the current directory does. See chmod for more information on modes and permissions.

Additional resources

Official getcwd documentation

Newsletter

Nejlepsi tipy a triky o PHP do Vaseho e-mailu. Clanky a novinky nejen ze sveta PHP a programovani.