php getcwd函数

getcwd

(PHP 4, PHP 5)

getcwd — 取得当前工作目录

reject note 说明

string getcwd ( void )

取得当前工作目录。

reject note 返回值

成功则返回当前工作目录,失败返回 FALSE

在某些 Unix 的变种下,如果任何父目录没有设定可读或搜索模式,即使当前目录设定了, getcwd() 还是会返回 FALSE。有关模式与权限的更多信息见 chmod()

reject note 范例

 

Example #1 getcwd() 例子

<?php

// current directory
echo getcwd() . "\n";

chdir('cvs');

// current directory
echo getcwd() . "\n";

?>

以上例程的输出类似于:

/home/didou
/home/didou/cvs
posted @ 2013-01-08 09:35  !!!!!!!!!!!  阅读(364)  评论(0编辑  收藏  举报