PHP getcwd() 函數
getcwd 的全稱是“Get Current Working Directory”,函數getcwd() 用於獲取當前工作目錄的名稱,它不接受任何參數並返回當前工作目錄。
用法:
getcwd();
參數:
- 它不接受任何參數。
返回值:
如果函數執行成功則返回當前工作目錄,如果函數執行失敗則返回"FALSE"。
示例:獲取當前工作目錄名稱的PHP代碼
<?php
$result = getcwd();
echo "current working directory is:".$result."<br/>";
?>
輸出
current working directory is:/home
相關用法
- PHP getcwd( )用法及代碼示例
- PHP getimagesizefromstring()用法及代碼示例
- PHP get_class()用法及代碼示例
- PHP gethostnamel()用法及代碼示例
- PHP getlastmod()用法及代碼示例
- PHP getservbyport()用法及代碼示例
- PHP get_class_methods()用法及代碼示例
- PHP get_headers()用法及代碼示例
- PHP gethostbyname()用法及代碼示例
- PHP gettimeofday()用法及代碼示例
- PHP getprotobynumber()用法及代碼示例
- PHP getimagesize()用法及代碼示例
- PHP gettype()用法及代碼示例
- PHP get_browser()用法及代碼示例
- PHP getdate()用法及代碼示例
- PHP gethostname()用法及代碼示例
- PHP get_object_vars()用法及代碼示例
- PHP get_defined_vars()用法及代碼示例
- PHP get_called_class()用法及代碼示例
注:本文由純淨天空篩選整理自 PHP getcwd() function with example。非經特殊聲明,原始代碼版權歸原作者所有,本譯文未經允許或授權,請勿轉載或複製。