(PHP 4 >= 4.3.0, PHP 5)
file_get_contents — 将整个文件读入一个字符串
$filename
[, bool $use_include_path
=
false [, resource $context
[, int $offset
=
-1 [, int $maxlen
]]]] )和 file() 一样,只除了 file_get_contents() 把文件读入一个字符串。将在参数 offset
所指定的位置开始读取长度为 maxlen
的内容。如果失败,file_get_contents() 将返回 FALSE
。
file_get_contents() 函数是用来将文件的内容读入到一个字符串中的首选方法。如果操作系统支持还会使用内存映射技术来增强性能。
Note:
如果要打开有特殊字符的 URL (比如说有空格),就需要使用 urlencode() 进行 URL 编码。
file_get_contents url,布布扣,bubuko.com
原文地址:http://www.cnblogs.com/fupeng/p/3737447.html