chdir
bool chdir(string dir) Changes the current working directory of the current instance of PHP to directory dir.
Returns:
FALSE if unable to change the current working directory; TRUE for all other cases
Description:
chdir() attempts to change the current PHP instance’s current working directory to dir . PHP uses the current working directory as the starting point for any path search in which the pathname is not absolute. This means that most function calls that relate to the filesystem will use the current working directory as the directory in which they operate, unless the pathname specified in the function call is absolute.
Note:
If chdir() fails, a warning is generated. To suppress the warning, place a single @ before the function call: ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access