函数名:posix_getcwd()
函数描述:获取当前工作目录的绝对路径
适用版本:PHP 4, PHP 5, PHP 7
用法: string posix_getcwd ( void )
参数: 该函数没有参数
返回值: 返回当前工作目录的绝对路径,若失败则返回false
示例:
// 示例1:获取当前工作目录的绝对路径
$currentDir = posix_getcwd();
echo "当前工作目录:".$currentDir;
// 示例2:改变当前工作目录,再获取绝对路径
chdir('/path/to/another/directory');
$currentDir = posix_getcwd();
echo "当前工作目录:".$currentDir;
说明: