當前位置: 首頁> 函數類別大全> file_exists

file_exists

檢查文件或目錄是否存在
名稱:file_exists
分類:文件系統
所屬語言:php
一句話介紹:檢查文件或目錄是否存在。

實例

<span class="token php language-php"><span class="token delimiter important"><?php</span>
<span class="token keyword">echo</span> <span class="token function">file_exists</span> <span class="token punctuation">(</span> <span class="token string double-quoted-string">"test.txt"</span> <span class="token punctuation">)</span> <span class="token punctuation">;</span>
<span class="token delimiter important">?></span></span>

輸出:

 1
同類函數
  • 返迴路徑中的文件名部分 basename

    basename

    返迴路徑中的文件名部分
  • 返迴路徑中的目錄部分 dirname

    dirname

    返迴路徑中的目錄部分
  • 將數據寫入文件 file_put_contents

    file_put_contents

    將數據寫入文件
  • 打開文件或URL fopen

    fopen

    打開文件或URL
  • 清除文件狀態緩存 clearstatcache

    clearstatcache

    清除文件狀態緩存
  • 改變文件所屬的組 chgrp

    chgrp

    改變文件所屬的組
  • 同步對文件的更改(包括元數據) fsync

    fsync

    同步對文件的更改(包括元數據)
  • 獲取文件類型 filetype

    filetype

    獲取文件類型