Curriculum
Course: PHP Basic
Login

Curriculum

PHP Basic

PHP Install

0/1

PHP Casting

0/1

PHP Constants

0/1

PHP Magic Constants

0/1

PHP Operators

0/1

PHP Reference

0/276
Text lesson

getcwd()

Example

Retrieve 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:

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

PHP Version:

4.0+