当前位置: 首页> 函数类别大全> 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?
)
同类函数
  • 测试文件指针是否到了文件结束的位置  feof

    feof

    测试文件指针是否到了文件结束的位置
  • 返回文件系统或磁盘分区的总大小  disk_total_space

    disk_total_space

    返回文件系统或磁盘分区的总大小
  • 将行格式化为 CSV 并写入文件指针  fputcsv

    fputcsv

    将行格式化为CSV并写入文件指针
  • 获取文件所有者  fileowner

    fileowner

    获取文件所有者
  • 改变文件模式  chmod

    chmod

    改变文件模式
  • fwrite 的别名  fputs

    fputs

    fwrite的别名
  • 取得文件的组  filegroup

    filegroup

    取得文件的组
  • 将上传的文件移动到新位置  move_uploaded_file

    move_uploaded_file

    将上传的文件移动到新位置