function.stream-get-meta-data.html

来自「php的帮助文档,涉及到PHP的案例和基本语法,以及实际应用内容」· HTML 代码 · 共 158 行

HTML
158
字号
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"><html> <head>  <title>Retrieves header/meta data from streams/file pointers</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.stream-get-line.html">stream_get_line</a></div> <div class="next" style="text-align: right; float: right;"><a href="function.stream-get-transports.html">stream_get_transports</a></div> <div class="up"><a href="ref.stream.html">Stream Functions</a></div> <div class="home"><a href="index.html">PHP Manual</a></div></div><hr /><div id="function.stream-get-meta-data" class="refentry"> <div class="refnamediv">  <h1 class="refname">stream_get_meta_data</h1>  <p class="verinfo">(PHP 4 &gt;= 4.3.0, PHP 5)</p><p class="refpurpose"><span class="refname">stream_get_meta_data</span> &mdash; <span class="dc-title">Retrieves header/meta data from streams/file pointers</span></p> </div> <div class="refsect1 unknown">  <h3 class="title">Description</h3>  <div class="methodsynopsis dc-description">   <span class="type">array</span> <span class="methodname"><b><b>stream_get_meta_data</b></b></span>    ( <span class="methodparam"><span class="type">resource</span> <tt class="parameter">$stream</tt></span>   )</div>  <p class="simpara">   Returns information about an existing <i><tt class="parameter">stream</tt></i>.   The stream can be any stream created by <a href="function.fopen.html" class="function">fopen()</a>,   <a href="function.fsockopen.html" class="function">fsockopen()</a> and <a href="function.pfsockopen.html" class="function">pfsockopen()</a>.   The result array contains the following items:  </p>  <ul class="itemizedlist">   <li class="listitem">    <p class="para">     <i><tt class="parameter">timed_out</tt></i> (bool) - <b><tt>TRUE</tt></b> if the stream     timed out while waiting for data on the last call to     <a href="function.fread.html" class="function">fread()</a> or <a href="function.fgets.html" class="function">fgets()</a>.    </p>   </li>   <li class="listitem">    <p class="para">     <i><tt class="parameter">blocked</tt></i> (bool) - <b><tt>TRUE</tt></b> if the stream is     in blocking IO mode. See <a href="function.stream-set-blocking.html" class="function">stream_set_blocking()</a>.    </p>   </li>   <li class="listitem">    <p class="para">     <i><tt class="parameter">eof</tt></i> (bool) - <b><tt>TRUE</tt></b> if the stream has reached     end-of-file.  Note that for socket streams this member can be <b><tt>TRUE</tt></b>     even when <i><tt class="parameter">unread_bytes</tt></i> is non-zero.  To     determine if there is more data to be read, use     <a href="function.feof.html" class="function">feof()</a> instead of reading this item.    </p>   </li>   <li class="listitem">    <p class="para">     <i><tt class="parameter">unread_bytes</tt></i> (int) - the number of bytes     currently contained in the PHP&#039;s own internal buffer.    </p>    <blockquote><p><b class="note">Note</b>:      <span class="simpara">      You shouldn&#039;t use this value in a script.     </span>    </p></blockquote>   </li>  </ul>  <p class="simpara">   The following items were added in PHP 4.3.0:  </p>  <ul class="itemizedlist">   <li class="listitem">    <p class="para">     <i><tt class="parameter">stream_type</tt></i> (string) - a label describing     the underlying implementation of the stream.    </p>   </li>   <li class="listitem">    <p class="para">     <i><tt class="parameter">wrapper_type</tt></i> (string) - a label describing     the protocol wrapper implementation layered over the stream.     See <a href="wrappers.html" class="xref">List of Supported Protocols/Wrappers</a> for more information about wrappers.    </p>   </li>   <li class="listitem">    <p class="para">     <i><tt class="parameter">wrapper_data</tt></i> (mixed) - wrapper specific     data attached to this stream.  See <a href="wrappers.html" class="xref">List of Supported Protocols/Wrappers</a> for     more information about wrappers and their wrapper data.    </p>   </li>   <li class="listitem">    <p class="para">     <i><tt class="parameter">filters</tt></i> (array) - and array containing     the names of any filters that have been stacked onto this stream.     Documentation on filters can be found in the     <a href="filters.html" class="link">Filters appendix</a>.    </p>   </li>  </ul>  <blockquote><p><b class="note">Note</b>:        This function was introduced in PHP 4.3.0, but prior to this version,    <a href="function.socket-get-status.html" class="function">socket_get_status()</a> could be used to retrieve    the first four items, for <em class="emphasis">socket based streams only</em>.   <br />       In PHP 4.3.0 and later,    <a href="function.socket-get-status.html" class="function">socket_get_status()</a> is an alias for this function.   <br />  </p></blockquote>  <blockquote><p><b class="note">Note</b>:    <span class="simpara">This function does NOT work on sockets created by the <a href="ref.sockets.html" class="link">Socket extension</a>.   </span>  </p></blockquote>  <p class="simpara">   The following items were added in PHP 5.0.0:  </p>  <ul class="itemizedlist">   <li class="listitem">    <p class="para">     <i><tt class="parameter">mode</tt></i> (string) - the type of access required for     this stream (see Table 1 of the <a href="function.fopen.html" class="link">fopen()</a> reference)    </p>   </li>   <li class="listitem">    <p class="para">     <i><tt class="parameter">seekable</tt></i> (bool) - whether the current stream can     be seeked.    </p>   </li>   <li class="listitem">    <p class="para">     <i><tt class="parameter">uri</tt></i> (string) - the URI/filename associated with this     stream.    </p>   </li>  </ul> </div></div><hr /><div style="text-align: center;"> <div class="prev" style="text-align: left; float: left;"><a href="function.stream-get-line.html">stream_get_line</a></div> <div class="next" style="text-align: right; float: right;"><a href="function.stream-get-transports.html">stream_get_transports</a></div> <div class="up"><a href="ref.stream.html">Stream Functions</a></div> <div class="home"><a href="index.html">PHP Manual</a></div></div></body></html>

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?