PHP函数file_get_contents介绍
定义和用法
file_get_contents() 函数把整个文件读入一个字符串中。
和 file() 一样,不同的是 file_get_contents() 把文件读入一个字符串。
file_get_contents() 函数是用于将文件的内容读入到一个字符串中的首选方法。如果操作系统支持,还会使用内存映射技术来增强性能。
语法
file_get_contents(path,include_path,context,start,max_length)
说明
对 context 的支持是 PHP 5.0.0 添加的。
提示和注释
注释:本函数可安全用于二进制对象。
例子
<?phpprint_r(file("test.txt"));?>
输出:
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?)
本文出自:琅枫个人博客。如需转载请注明出处!
本文出处:"https://www.phpfeng.cn/function/256.html"
如果您觉得文章对你有帮助,可以进行打赏。
打赏多少,您高兴就行,谢谢您对琅枫博客的支持! ~(@^_^@)~
微信打赏

支付宝打赏
