PHP getcwd() 函数

约 173 字 更新于 2026-11-18 5iyo.com

PHP getcwd() 函数

实例

获取当前工作目录:

<?php
echo getcwd()
?>

结果:

/home/php


定义和用法

getchwd() 函数返回当前工作目录。


语法

getcwd();

技术细节

返回值: 成功则返回当前工作目录。失败则返回 FALSE。
PHP 版本: 4.0+


PHP Directory 参考手册