该readfile()函数读取文件并将其写入输出缓冲区。
readfile(file_path, include_path, context)
file_path-文件的路径
include_path-如果要在include_path中搜索文件,请将此参数设置为TRUE
context-指定流的行为。
该readfile()函数返回从文件读取的字节数。
<?php
echo readfile("one.txt");
?>以下是返回字节数的输出。
输出结果
This is demo text! 18