PHP file_exists() 函式
❮ PHP 檔案系統參考定義和用法
file_exists() 函式用於檢查檔案或目錄是否存在。
注意: 此函式的結果會被快取。使用 clearstatcache() 來清除快取。
語法
file_exists(path)
引數值
引數 | 描述 |
---|---|
path | 必需。指定要檢查的檔案或目錄的路徑 |
技術詳情
返回值 | 如果檔案或目錄存在,則返回 TRUE,否則返回 FALSE。 |
---|---|
PHP 版本 | 4.0+ |
❮ PHP 檔案系統參考
file_exists() 函式用於檢查檔案或目錄是否存在。
注意: 此函式的結果會被快取。使用 clearstatcache() 來清除快取。
file_exists(path)
引數 | 描述 |
---|---|
path | 必需。指定要檢查的檔案或目錄的路徑 |
返回值 | 如果檔案或目錄存在,則返回 TRUE,否則返回 FALSE。 |
---|---|
PHP 版本 | 4.0+ |
如果您想將 W3Schools 服務用於教育機構、團隊或企業,請傳送電子郵件給我們
sales@w3schools.com
如果您想報告錯誤,或想提出建議,請傳送電子郵件給我們
help@w3schools.com