PHP » I/O » chdir()

Syntax:
bool chdir(string dir)
dir
Directory to change to.

Changes the current working directory.

TRUE is returned on success. If an error occurs, FALSE is returned.

Examples

Code:
<?php

if (chdir("upload")) {
   print "Changed current directory successfully";
}

?>
Output:
Changed current directory successfully
Explanation:

This code changes the working directory to the upload directory in the previous working directory.

See Also: