Web | This Site

Learning PHP
Advanced PHP
PHP Function Reference
PHP Useful Resources
Selected Reading
© 2011 TutorialsPoint.COM

| Home |  | References |  | Discussion Forums |  | About TP

# PHP Function getcwd()

## Syntax

    string getcwd ( void );

## Definition and Usage

Gets the current working directory.

## Paramters

Parameter | Description
--- | ---
void | NA

## Return Value

Returns the current working directory on success, or FALSE on failure.

## Example

Following is the usage of this function:

    <?php
    // current directory
    echo getcwd() . "\n";

    getcwd('html');

    // current directory
    echo getcwd() . "\n";
    ?>

This will produce following result:

    /home/tutorialspoint
    /home/tutorialspoint/html

Advertisement

Online Image Processing

Indian Baby Names