PHP  
downloads | documentation | faq | getting help | mailing lists | reporting bugs | php.net sites | links | my php.net 
search for in the  
<file_existsfile_put_contents>
Last updated: Mon, 16 Jul 2012

file_get_contents

(PHP 4 >= 4.3.0, PHP 5)

file_get_contents -- 将整个文件读入一个字符串

说明

string file_get_contents ( string filename [, int use_include_path [, resource context]] )

file() 一样,只除了 file_get_contents() 将文件返回为一个字符串。

file_get_contents() 函数是用来将文件的内容读入到一个字符串中的首选方法。如果操作系统支持还会使用内存映射技术来增强性能。

注: 该函数可安全用于二进制对象。

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

注: Context 支持是 PHP 5.0.0 新加的。

参见 fgets()file()fread()include()readfile()




<file_existsfile_put_contents>
 Last updated: Mon, 16 Jul 2012
 
Copyright © 2001-2005 The PHP Group
All rights reserved.
This unofficial mirror is operated at: http://manual.phpv.net/
Last updated: Thu Jul 7 19:13:47 2005 CST