w3resource
PHP Tutorial

PHP: getcwd() function

Description

The getcwd() function is used to get the current working directory.

Version:

(PHP 4 and above)

Syntax:

getcwd()

Return value:

The current working directory on success, or FALSE on failure.

Value Type: String

Example:

<?php
echo getcwd();
?>

Sample Output:

C:\wamp\www\php\function-reference

View the example in the browser

See also

PHP Function Reference



New Content: Composer: Dependency manager for PHP, R Programming