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

file

把整个文件读入一个数组中
名称:file
分类:文件系统
所属语言:php
一句话介绍:把文件读入一个数组中。

实例

<span class="token php language-php"><span class="token delimiter important"><?php</span>
<span class="token function">print_r</span><span class="token punctuation">(</span><span class="token function">file</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 punctuation">;</span>
<span class="token delimiter important">?></span></span>

输出:

Array
(
[0] => Hello World. Testing testing!
[1] => Another day, another line.
[2] => If the array picks up this line,
[3] => then is it a pickup line?
)
同类函数
  • 倒回文件指针的位置  rewind

    rewind

    倒回文件指针的位置
  • 删除文件  unlink

    unlink

    删除文件
  • 获取真实路径缓冲区的大小  realpath_cache_size

    realpath_cache_size

    获取真实路径缓冲区的大小
  • 将数据(但不是元数据)同步到文件  fdatasync

    fdatasync

    将数据(但不是元数据)同步到文件
  • 拷贝文件  copy

    copy

    拷贝文件
  • 参见 unlink() 或 unset()(PHP 没有 delete 关键词或函数)  delete

    delete

    参见unlink()或unset()(P
  • 获取文件权限  fileperms

    fileperms

    获取文件权限
  • 解析配置字符串  parse_ini_string

    parse_ini_string

    解析配置字符串