📄 function.readfile.html
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"><html> <head> <title>Outputs a file</title> <meta http-equiv="content-type" content="text/html; charset=UTF-8"> </head> <body><div style="text-align: center;"> <div class="prev" style="text-align: left; float: left;"><a href="function.popen.html">popen</a></div> <div class="next" style="text-align: right; float: right;"><a href="function.readlink.html">readlink</a></div> <div class="up"><a href="ref.filesystem.html">Filesystem Functions</a></div> <div class="home"><a href="index.html">PHP Manual</a></div></div><hr /><div id="function.readfile" class="refentry"> <div class="refnamediv"> <h1 class="refname">readfile</h1> <p class="verinfo">(PHP 4, PHP 5)</p><p class="refpurpose"><span class="refname">readfile</span> — <span class="dc-title">Outputs a file</span></p> </div> <div class="refsect1 description"> <h3 class="title">Description</h3> <div class="methodsynopsis dc-description"> <span class="type">int</span> <span class="methodname"><b><b>readfile</b></b></span> ( <span class="methodparam"><span class="type">string</span> <tt class="parameter">$filename</tt></span> [, <span class="methodparam"><span class="type">bool</span> <tt class="parameter">$use_include_path</tt></span> [, <span class="methodparam"><span class="type">resource</span> <tt class="parameter">$context</tt></span> ]] )</div> <p class="para rdfs-comment"> Reads a file and writes it to the output buffer. </p> </div> <div class="refsect1 parameters"> <h3 class="title">Parameters</h3> <p class="para"> <dl> <dt> <span class="term"><i><tt class="parameter">filename</tt></i></span> <dd> <p class="para"> The filename being read. </p> </dd> </dt> <dt> <span class="term"><i><tt class="parameter">use_include_path</tt></i></span> <dd> <p class="para"> You can use the optional second parameter and set it to <b><tt>TRUE</tt></b>, if you want to search for the file in the <a href="ini.core.html#ini.include-path" class="link">include_path</a>, too. </p> </dd> </dt> <dt> <span class="term"><i><tt class="parameter">context</tt></i></span> <dd> <p class="para"> A context stream <a href="language.types.resource.html" class="type resource">resource</a>. </p> </dd> </dt> </dl> </p> </div> <div class="refsect1 returnvalues"> <h3 class="title">Return Values</h3> <p class="para"> Returns the number of bytes read from the file. If an error occurs, <b><tt>FALSE</tt></b> is returned and unless the function was called as @<b>readfile()</b>, an error message is printed. </p> </div> <div class="refsect1 notes"> <h3 class="title">Notes</h3> <div class="tip"><b class="tip">Tip</b><p class="simpara">A URL can be used as afilename with this function if the <a href="filesystem.configuration.html#ini.allow-url-fopen" class="link">fopen wrappers</a> have been enabled.See <a href="function.fopen.html" class="function">fopen()</a> for more details on how to specifythe filename and <a href="wrappers.html" class="xref">List of Supported Protocols/Wrappers</a> for a list of supportedURL protocols.</p></div> <blockquote><p><b class="note">Note</b>: <span class="simpara">Context support was addedwith PHP 5.0.0. For a description of <i>contexts</i>, refer to<a href="ref.stream.html" class="xref">Stream Functions</a>.</span></p></blockquote> </div> <div class="refsect1 seealso"> <h3 class="title">See Also</h3> <p class="para"> <ul class="simplelist"> <li class="member"><a href="function.fpassthru.html" class="function" rel="rdfs-seeAlso">fpassthru()</a></li> <li class="member"><a href="function.file.html" class="function" rel="rdfs-seeAlso">file()</a></li> <li class="member"><a href="function.fopen.html" class="function" rel="rdfs-seeAlso">fopen()</a></li> <li class="member"><b>include()</b></li> <li class="member"><b>require()</b></li> <li class="member"><a href="function.virtual.html" class="function" rel="rdfs-seeAlso">virtual()</a></li> <li class="member"><a href="function.file-get-contents.html" class="function" rel="rdfs-seeAlso">file_get_contents()</a></li> <li class="member"><a href="wrappers.html" class="xref">List of Supported Protocols/Wrappers</a></li> </ul> </p> </div></div><hr /><div style="text-align: center;"> <div class="prev" style="text-align: left; float: left;"><a href="function.popen.html">popen</a></div> <div class="next" style="text-align: right; float: right;"><a href="function.readlink.html">readlink</a></div> <div class="up"><a href="ref.filesystem.html">Filesystem Functions</a></div> <div class="home"><a href="index.html">PHP Manual</a></div></div></body></html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -