現在の位置: ホーム> 関数カテゴリ一覧> 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。テスト!"</span> <span class="token punctuation">)</span> <span class="token punctuation">;</span>
<span class="token delimiter important">?></span></span>

出力:

 26
類似の関数
  • stream_set_write_bufferのエイリアス set_file_buffer

    set_file_buffer

    stream_set_write_buf
  • ファイル全体を配列に読んでください file

    file

    ファイル全体を配列に読んでください
  • ファイルポインターから行を読んで、HTMLタグを除外します fgetss

    fgetss

    ファイルポインターから行を読んで、HTM
  • ディレクトリを削除します rmdir

    rmdir

    ディレクトリを削除します
  • link()またはunset()を参照してください(PHPにはキーワードや関数の削除がありません) delete

    delete

    link()またはunset()を参照し
  • 一時ファイルを作成します tmpfile

    tmpfile

    一時ファイルを作成します
  • ファイルポインターから文字を読み取ります fgetc

    fgetc

    ファイルポインターから文字を読み取ります
  • ファイルポインター位置を巻き戻します rewind

    rewind

    ファイルポインター位置を巻き戻します
人気記事(にんききじ)