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



Become a Patron!

Follow us on Facebook and Twitter for latest update.

It will be nice if you may share this link in any developer community or anywhere else, from where other developers may find this content. Thanks.

https://www.w3resource.com/php/function-reference/getcwd.php