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

readfile

输出文件
名称:readfile
分类:文件系统
所属语言:php
一句话介绍:读取一个文件,并输出到输出缓冲。

实例

<span class="token php language-php"><span class="token delimiter important"><?php</span>
<span class="token keyword">echo</span> <span class="token function">readfile</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>

输出:

There are two lines in this file.
This is the last line.
57
同类函数
  • 从文件指针中读取一行并过滤掉 HTML 标记  fgetss

    fgetss

    从文件指针中读取一行并过滤掉HTML标记
  • 读取文件(可安全用于二进制文件)  fread

    fread

    读取文件(可安全用于二进制文件)
  • 清除文件状态缓存  clearstatcache

    clearstatcache

    清除文件状态缓存
  • 测试文件指针是否到了文件结束的位置  feof

    feof

    测试文件指针是否到了文件结束的位置
  • 获取文件修改时间  filemtime

    filemtime

    获取文件修改时间
  • 寻找与模式匹配的文件路径  glob

    glob

    寻找与模式匹配的文件路径
  • 检查文件或目录是否存在  file_exists

    file_exists

    检查文件或目录是否存在
  • 建立一个临时文件  tmpfile

    tmpfile

    建立一个临时文件
热门文章