PHP chdir() 函数
PHP 教程
· 2019-01-24 11:59:20
实例
改变当前的目录:
<?php
// Get current directory
echo getcwd() . "<br>";
// Change directory
chdir("images");
// Get current directory
echo getcwd();
?>
// Get current directory
echo getcwd() . "<br>";
// Change directory
chdir("images");
// Get current directory
echo getcwd();
?>
结果:
/home/php
/home/php/images
/home/php/images
定义和用法
chdir() 函数改变当前的目录。
语法
chdir(directory);
| 参数 | 描述 |
|---|---|
| directory | 必需。规定新的当前目录。 |
技术细节
| 返回值: | 成功则返回 TRUE。失败则返回 FALSE,且抛出 E_WARNING 级别的错误。 |
|---|---|
| PHP 版本: | 4.0+ |
点击查看所有 PHP 教程 文章: https://www.codercto.com/courses/l/5.html
GitHub入门与实践
[日] 大塚弘记 / 支鹏浩、刘斌 / 人民邮电出版社 / 2015-7 / 39.00元
本书从Git的基本知识和操作方法入手,详细介绍了GitHub的各种功能,GitHub与其他工具或服务的协作,使用GitHub的开发流程以及如何将GitHub引入到企业中。在讲解GitHub的代表功能Pull Request时,本书专门搭建了供各位读者实践的仓库,邀请各位读者进行Pull Request并共同维护。一起来看看 《GitHub入门与实践》 这本书的介绍吧!