当前位置: 首页> 函数类别大全> file_get_contents

file_get_contents

将整个文件读入一个字符串
名称:file_get_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_get_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 punctuation">;</span>
<span class="token delimiter important">?></span></span>

输出:

This is a test file with test text.
同类函数
  • 返回路径中的目录部分  dirname

    dirname

    返回路径中的目录部分
  • 读取文件(可安全用于二进制文件)  fread

    fread

    读取文件(可安全用于二进制文件)
  • 更改当前的 umask  umask

    umask

    更改当前的umask
  • 建立一个硬连接  link

    link

    建立一个硬连接
  • 解析配置字符串  parse_ini_string

    parse_ini_string

    解析配置字符串
  • 在文件指针中定位  fseek

    fseek

    在文件指针中定位
  • 获取真实路径缓冲区的大小  realpath_cache_size

    realpath_cache_size

    获取真实路径缓冲区的大小
  • 获取一个连接的信息  linkinfo

    linkinfo

    获取一个连接的信息