w3resource

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

Previous: closedir
Next: opendir



Follow us on Facebook and Twitter for latest update.