TUTORIALBackendFETCHED

PHP getcwd() 函数

PHP getcwd() 函数 PHP Directory 参考手册 实例 获取当前工作目录: <?phpecho getcwd()?> 结果: /home/php 定义和用法 getchwd() 函数返回当前工作目录。 语法 getcwd(); 技术细节 返回值: 成功则返回当前工作目录。失败则返回 FALSE。 PHP 版本: 4.0+ PHP Directo..

Updated 7/16/2026

Tutorial detail pages default to noindex.

PHP getcwd() 函数

PHP Directory PHP Directory 参考手册

实例

获取当前工作目录:

<?php
echo getcwd()
?>

结果:

/home/php


定义和用法

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


语法

getcwd();

技术细节

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


PHP Directory PHP Directory 参考手册