uTools-Manuals/docs/php/stream_get_meta_data.html
2019-04-28 19:00:34 +08:00

127 lines
5.8 KiB
HTML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<title>从封装协议文件指针中取得报头/元数据</title>
</head>
<body class="docs"><div id="layout">
<div id="layout-content"><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, PHP 7)</p><p class="refpurpose"><span class="refname">stream_get_meta_data</span> &mdash; <span class="dc-title">从封装协议文件指针中取得报头/元数据</span></p>
</div>
<div class="refsect1 unknown-seealsp" id="refsect1-function.stream-get-meta-data-unknown-seealsp">
<h3 class="title">说明</h3>
<div class="methodsynopsis dc-description">
<span class="methodname"><strong>stream_get_meta_data</strong></span>
( <span class="methodparam"><span class="type">int</span> <code class="parameter">$fp</code></span>
) : <span class="type">array</span></div>
<p class="simpara">
返回现有 <code class="parameter">stream</code> 的信息。可以是任何通过
<span class="function"><a href="fopen.html" class="function">fopen()</a></span><span class="function"><a href="fsockopen.html" class="function">fsockopen()</a></span>
<span class="function"><a href="pfsockopen.html" class="function">pfsockopen()</a></span> 建立的流。返回的数组包含以下项目:
</p>
<ul class="itemizedlist">
<li class="listitem">
<p class="para">
<code class="parameter">timed_out</code> (bool) - 如果在上次调用
<span class="function"><a href="fread.html" class="function">fread()</a></span> 或者 <span class="function"><a href="fgets.html" class="function">fgets()</a></span>
中等待数据时流超时了则为 <strong><code>TRUE</code></strong>
</p>
</li>
<li class="listitem">
<p class="para">
<code class="parameter">blocked</code> (bool) - 如果流处于阻塞
IO 模式时为 <strong><code>TRUE</code></strong>。参见 <span class="function"><a href="stream_set_blocking.html" class="function">stream_set_blocking()</a></span>
</p>
</li>
<li class="listitem">
<p class="para">
<code class="parameter">eof</code> (bool) - 如果流到达文件末尾时为
<strong><code>TRUE</code></strong>。注意对于 socket 流甚至当 <code class="parameter">unread_bytes</code>
为非零值时也可以为 <strong><code>TRUE</code></strong>。要测定是否有更多数据可读,用
<span class="function"><a href="feof.html" class="function">feof()</a></span> 替代读取本项目的值。
</p>
</li>
<li class="listitem">
<p class="para">
<code class="parameter">unread_bytes</code> (int) - 当前在 PHP 自己的内部缓冲区中的字节数。
</p>
<blockquote class="note"><p><strong class="note">Note</strong>:
<span class="simpara">
不要在脚本中使用此值。
</span>
</p></blockquote>
</li>
</ul>
<p class="simpara">
以下项目是 PHP 4.3 新加的:
</p>
<ul class="itemizedlist">
<li class="listitem">
<p class="para">
<code class="parameter">stream_type</code> (string) - 一个描述流底层实现的标注。
</p>
</li>
<li class="listitem">
<p class="para">
<code class="parameter">wrapper_type</code> (string) -
一个描述流的分层协议封装实现的标注。更多关于封装协议的信息见
<a href="wrappers.html" class="xref">支持的协议和封装协议</a>
</p>
</li>
<li class="listitem">
<p class="para">
<code class="parameter">wrapper_data</code> (mixed) -
当前流附加的封装协议数据。更多封装协议及其数据的信息见
<a href="wrappers.html" class="xref">支持的协议和封装协议</a>
</p>
</li>
<li class="listitem">
<p class="para">
<code class="parameter">filters</code> (array) -
包含有被叠加在当前流的任何过滤器名的数组。过滤器的文档见附录中的<a href="filters.html" class="link">可用过滤器列表</a>
</p>
</li>
</ul>
<blockquote class="note"><p><strong class="note">Note</strong>:
<p class="para">
本函数是 PHP 4.3 引进的,在此版本之前,可以用 <span class="function"><a href="socket_get_status.html" class="function">socket_get_status()</a></span>
来取得前四个项目并且<em class="emphasis">仅能用于基于 socket 的流</em>
</p>
<p class="para">
在 PHP 4.3 及以后版本中,<span class="function"><a href="socket_get_status.html" class="function">socket_get_status()</a></span>
是本函数的别名。
</p>
</p></blockquote>
<blockquote class="note"><p><strong class="note">Note</strong>:
<span class="simpara">
本函数不能作用于通过 <a href="ref.sockets.html" class="link">Socket 扩展库</a>创建的流。
</span>
</p></blockquote>
<p class="simpara">
以下项目为 PHP 5.0 新加:
</p>
<ul class="itemizedlist">
<li class="listitem">
<p class="para">
<code class="parameter">mode</code> (string) - 对当前流所要求的访问类型(见
<a href="fopen.html" class="link">fopen()</a> 中的表格 1
</p>
</li>
<li class="listitem">
<p class="para">
<code class="parameter">seekable</code> (bool) - 是否可以在当前流中定位。
</p>
</li>
<li class="listitem">
<p class="para">
<code class="parameter">uri</code> (string) - 与当前流关联的 URI 或文件名。
</p>
</li>
</ul>
</div>
</div></div></div></body></html>