PHP getcwd() Function

Example

Get the current working directory:

<?php
echo getcwd()
?>

Result:

/home/php

Definition and Usage

The getchwd() function returns the current working directory.

Syntax

getcwd();

Technical Details

Return Value: Returns the current working directory if successful. Returns FALSE on failure.
PHP Version: 4.0+