chdir
Description
Syntax
chdir(
string $directory
): boolParameters
directory
The new current directory
Return
Returns true on success or false on failure.
Examples
1 · return
<? $directory = "public_html"; $return = chdir($directory); var_export($return);
true
2 · getcwd
<? echo getcwd() . PHP_EOL; $directory = "public_html"; chdir($directory); echo getcwd();
/home/user /home/user/public_html