English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية
PHP Directory Reference Manual
The getcwd() function gets the current working directory
string getcwd(void);
It gets the current working directory.
Serial Number | Parameters and Description |
---|---|
1 | void No parameters required |
Successfully returns the current working directory, returns FALSE on failure.
The following is the usage of this function, getting the current working directory:
<?php echo getcwd() . "\n"; getcwd('html'); echo getcwd() . "\n"; ?>
Output result:
/home/w3codebox /home/w3codebox/html