参数 | 描述 |
---|---|
filename | 必需。规定要读取的文件。 |
include_path | 必需。如果也想在 include_path 中搜索文件,可以使用该参数并将其设为 true。 |
context | 必需。规定文件句柄的环境。Context 是可以修改流的行为的一套选项。 |
对 context 参数的支持是 PHP 5.0.0 添加的。
提示:如果在 php.ini 文件中 "fopen wrappers" 已经被激活,则在本函数中可以把 URL 作为文件名来使用。
<?php echo readfile("test.txt"); ?>
输出:
There are two lines in this file. This is the last line. 57
制作:
http://www.7di.net 生活网搜集整理 参考: http://www.w3school.com.cn/php/func_filesystem_readfile.asp |