getcwd函數
PHP getcwd()函數 (PHP getcwd() function)
The full form of getcwd is "Get Current Working Directory", the function getcwd() is used to get the name of the current working directory, it does not accept any parameter and returns the current working directory.
getcwd的完整格式為“獲取當前工作目錄” ,該函數getcwd()用于獲取當前工作目錄的名稱,它不接受任何參數并返回當前工作目錄。
Syntax:
句法:
getcwd();
Parameter(s):
參數:
It does not accept any parameter.
它不接受任何參數。
Return value:
返回值:
If function execution is the success, it returns the current working directory and it returns "FALSE" if function execution is failed.
如果函數執行成功,則返回當前工作目錄,如果函數執行失敗,則返回“ FALSE”。
Example: PHP code to get the name of the current working directory
示例:PHP代碼獲取當前工作目錄的名稱
<?php
$result = getcwd();
echo "current working directory is: ".$result."<br/>";
?>
Output
輸出量
current working directory is: /home
翻譯自: https://www.includehelp.com/php/getcwd-function-with-example.aspx
getcwd函數