PHP getcwd() Function

❮ PHP Directory Reference

Example

Get the current working directory:

<?php
echo getcwd();
?>

Result:

/home/php


Definition and Usage

The getcwd() function returns the current working directory.


Syntax

getcwd()


Technical Details

Return Value: The current working directory on success, FALSE on failure.
PHP Version: 4.0+

❮ PHP Directory Reference
Copyright 1999-2023 by Refsnes Data. All Rights Reserved.