当前位置:Gxlcms > PHP教程 > php改变当前的目录chdir()函数的用法

php改变当前的目录chdir()函数的用法

时间:2021-07-01 10:21:17 帮助过:3人阅读

chdir() 函数改变当前的目录。此函数成功则返回 TRUE。失败则返回 FALSE,且抛出 E_WARNING 级别的错误。

实例代码

  1. <?php
  2. if (chdir("upload")) {
  3. print "Changed current directory successfully";
  4. }
  5. ?>

输出结果:

  1. Changed current directory successfully
  2. Explanation:
  3. This code changes the working directory to the upload directory in the previous working directory.

以上就是php 改变当前的目录chdir() 函数的用法的详细内容,更多请关注Gxl网其它相关文章!

人气教程排行