getcwd
(PHP 4, PHP 5)
getcwd -- 取得当前工作目录
说明
string
getcwd
( void )
取得当前工作目录。
返回值
成功则返回当前工作目录,失败返回
FALSE
。
在某些 Unix 的变种下,如果任何父目录没有设定可读或搜索模式,即使当前目录设定了,
getcwd()
还是会返回
FALSE
。有关模式与权限的更多信息见
chmod()
。
范例
例子 1.
getcwd()
例子
<?php
// current directory
echo
getcwd
() .
"\n"
;
chdir
(
'cvs'
);
// current directory
echo
getcwd
() .
"\n"
;
?>
|
上例的输出类似于:
/home/didou
/home/didou/cvs
|
|