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

file_put_contents

將數據寫入文件
名稱:file_put_contents
分類:文件系統
所屬語言: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_put_contents</span> <span class="token punctuation">(</span> <span class="token string double-quoted-string">"test.txt"</span> <span class="token punctuation">,</span> <span class="token string double-quoted-string">"Hello World. Testing!"</span> <span class="token punctuation">)</span> <span class="token punctuation">;</span>
<span class="token delimiter important">?></span></span>

輸出:

 26
同類函數
  • 提供有關文件的信息 stat

    stat

    提供有關文件的信息
  • 將行格式化為CSV 並寫入文件指針 fputcsv

    fputcsv

    將行格式化為CSV並寫入文件指針
  • 將數據寫入文件 file_put_contents

    file_put_contents

    將數據寫入文件
  • 取得文件的inode 修改時間 filectime

    filectime

    取得文件的inode修改時間
  • 獲取realpath 緩存條目 realpath_cache_get

    realpath_cache_get

    獲取realpath緩存條目
  • 尋找與模式匹配的文件路徑 glob

    glob

    尋找與模式匹配的文件路徑
  • 從文件指針中讀取字符 fgetc

    fgetc

    從文件指針中讀取字符
  • 建立一個硬連接 link

    link

    建立一個硬連接
熱門文章