chdir() 函数改变当前的目录。此函数成功则返回 true。失败则返回 false,且抛出 e_warning 级别的错误。
实例代码
<?php
if (chdir("upload")) {
print "Changed current directory successfully";
}
?>输出结果:
Changed current directory successfully Explanation: This code changes the working directory to the upload directory in the previous working directory.











