当前位置: 首页> 函数类别大全> 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
同类函数
  • 返回文件系统或磁盘分区的总大小  disk_total_space

    disk_total_space

    返回文件系统或磁盘分区的总大小
  • 寻找与模式匹配的文件路径  glob

    glob

    寻找与模式匹配的文件路径
  • 拷贝文件  copy

    copy

    拷贝文件
  • stream_set_write_buffer 的别名  set_file_buffer

    set_file_buffer

    stream_set_write_buf
  • 将数据写入文件  file_put_contents

    file_put_contents

    将数据写入文件
  • 建立符号连接  symlink

    symlink

    建立符号连接
  • 从文件指针中读取一行并过滤掉 HTML 标记  fgetss

    fgetss

    从文件指针中读取一行并过滤掉HTML标记
  • 修改符号链接的所有者  lchown

    lchown

    修改符号链接的所有者
热门文章