Latest web development tutorials

PHP getcwd () function

PHP Directory PHP Directory Reference

Examples

Gets the current working directory:

<?php
echo getcwd()
?>

result:

/home/php


Definition and Usage

getchwd () function returns the current working directory.


grammar

getcwd();

technical details

return value: Success, returns the current working directory. It failed to return FALSE.
PHP version: 4.0+


PHP Directory PHP Directory Reference