超越PHP PHP动态 | 经典文章 | CLASS | 相关下载 | 常见问题 | FORUM | WIKI | 在线手册
Site search:    
<popenreadlink>
Last updated: Fri, 22 Jun 2007

readfile

(PHP 3, PHP 4 , PHP 5)

readfile -- 输出一个文件

说明

int readfile ( string filename [, bool use_include_path [, resource context]])

读入一个文件并写入到输出缓冲。

返回从文件中读入的字节数。如果出错返回 FALSE 并且除非是以 @readfile() 形式调用,否则会显示错误信息。

提示: 如果“fopen wrappers”已经被激活,则您在使用该函数的时候,可以把 URL 作为文件名来使用。请参阅 fopen() 获取怎样指定文件名的详细信息以及支持的 URL 协议的列表附录 L

如果也想在 include_path 中搜索文件,可以使用可选的第二个参数并将其设为 TRUE

参见 fpassthru()file()fopen()include()require()virtual()file_get_contents()附录 L




add a note add a note User Contributed Notes
readfile
27-Feb-2003 10:50
Watch out when you use readfile to read big files ! Reading a file of 6 meg will result in php using 6 megs of memory ! Php might stop your script if you cross the memory limit. You're better of using fread when reading big files

<popenreadlink>
 Last updated: Fri, 22 Jun 2007
view source | feedback | send page | sitemap | aboutus   
Copyright ® 2002-2003 PHPE.NET. All rights reserved
Last updated:2002-11-22