PHP 教程 PHP 表单 PHP 高级教程 PHP 数据库 PHP XML PHP 与 AJAX PHP 参考手册

发布于 2016-11-18 14:31:11 | 69 次阅读 | 评论: 0 | 来源: 网络整理

实例

改变当前的目录:

 <?php
// Get current directory
 echo getcwd() . "<br>";

// Change directory
 chdir("images");

// Get current directory
 echo getcwd();
 ?> 

结果:

 /home/php
/home/php/images 


定义和用法

chdir() 函数改变当前的目录。


语法

 chdir(directory);

参数描述
directory必需。规定新的当前目录。

技术细节

返回值:成功则返回 TRUE。失败则返回 FALSE,且抛出 E_WARNING 级别的错误。
PHP 版本:4.0+


最新网友评论  共有(0)条评论 发布评论 返回顶部

Copyright © 2007-2017 PHPERZ.COM All Rights Reserved   冀ICP备14009818号  版权声明  广告服务