下一篇 » « 上一篇

目录管理函数库

作者:    时间:2008-01-22    来源:    点击:18559    本文共6篇文章 字体:[ ]

目录管理函数库

兼容:(PHP 3, PHP 4, PHP 5)
chdir -- 改变目录
语法:bool chdir ( string directory )
返回值:整数
函数种类: 文件存取

内容说明:
将 PHP 的当前目录改为directory。directory:新的当前目录。返回值如果成功则返回 TRUE,失败则返回 FALSE。


例子讲解:
 
<?php
// current directory
echo getcwd() . "\n";
chdir('public_html');
// current directory
echo getcwd() . "\n";
?> 


输出结果为:
/home/vincent
/home/vincent/public_html
 

注意:循环语句中会出现“ Warning: chdir(): No such file or directory (errno 2) in ***** on line *”错误。

php学习之家



<?php
// current directory
echo getcwd() . "\n";
for($i=1; $i<=2; $i++){
 chdir('whoist');
// current directory
echo getcwd() . "\n";
}
?>

  • 目录管理函数库 总目录
  • 目录管理函数库 下一页 目录管理函数库
责任编辑:semirock

最新评论(共有 1 条评论)更多评论...

  • 游客: 呼叫中心的评论 (2008-08-06 13:18 pm)
    中华热线专业为企业提供&lt;a href=http://www.chinahotline.net.cn&gt;呼叫中心&lt;/a&gt;及&lt;a href=http://www.chinahotline.net.cn&gt;呼叫中心建设&lt;/a&gt;的一站式服务,根据&lt;a href=http://www.chinahotline.net.cn&gt;深圳呼叫中心&lt;/a&gt;,北京呼叫中心,上海呼叫中心,广州呼叫中心等不同的城市的情况,提供不同的呼叫中心方案.
发表评论
密码: (游客不需要密码)
记住我【Alt+S 或 Ctrl+Enter 快速提交】

搜索工具


《PHP函数》点击排行