当前位置: 首页> 函数类别大全> 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?
)
同类函数
  • 检查文件或目录是否存在  file_exists

    file_exists

    检查文件或目录是否存在
  • 清除文件状态缓存  clearstatcache

    clearstatcache

    清除文件状态缓存
  • 返回文件指针读/写的位置  ftell

    ftell

    返回文件指针读/写的位置
  • 用模式匹配文件名  fnmatch

    fnmatch

    用模式匹配文件名
  • 返回规范化的绝对路径名  realpath

    realpath

    返回规范化的绝对路径名
  • 判断给定文件名是否为一个符号连接  is_link

    is_link

    判断给定文件名是否为一个符号连接
  • fwrite 的别名  fputs

    fputs

    fwrite的别名
  • 关闭进程文件指针  pclose

    pclose

    关闭进程文件指针
热门文章