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

85 lines
3.0 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>Check if a stream is a TTY</title>
</head>
<body class="docs"><div id="layout">
<div id="layout-content"><div id="function.stream-isatty" class="refentry">
<div class="refnamediv">
<h1 class="refname">stream_isatty</h1>
<p class="verinfo">(PHP 7 &gt;= 7.2.0)</p><p class="refpurpose"><span class="refname">stream_isatty</span> &mdash; <span class="dc-title">Check if a stream is a TTY</span></p>
</div>
<div class="refsect1 description" id="refsect1-function.stream-isatty-description">
<h3 class="title">说明</h3>
<div class="methodsynopsis dc-description">
<span class="methodname"><strong>stream_isatty</strong></span>
( <span class="methodparam"><span class="type">resource</span> <code class="parameter">$stream</code></span>
) : <span class="type">bool</span></div>
<p class="para rdfs-comment">
Determines if stream <code class="parameter">stream</code> refers to a valid terminal type device.
This is a more portable version of <span class="function"><a href="posix_isatty.html" class="function">posix_isatty()</a></span>, since it works on Windows systems too.
</p>
</div>
<div class="refsect1 parameters" id="refsect1-function.stream-isatty-parameters">
<h3 class="title">参数</h3>
<dl>
<dt>
<code class="parameter">stream</code></dt>
<dd>
<p class="para">
</p>
</dd>
</dl>
</div>
<div class="refsect1 returnvalues" id="refsect1-function.stream-isatty-returnvalues">
<h3 class="title">返回值</h3>
<p class="para">
成功时返回 <strong><code>TRUE</code></strong> 或者在失败时返回 <strong><code>FALSE</code></strong>
</p>
</div>
<div class="refsect1 examples" id="refsect1-function.stream-isatty-examples">
<h3 class="title">范例</h3>
<p class="para">
<div class="example" id="example-4829">
<p><strong>Example #1 <span class="function"><strong>stream_isatty()</strong></span> example</strong></p>
<div class="example-contents"><p>
This command can be used to determine if a standard output / standard error stream is redirected to a file.
</p></div>
<div class="example-contents"><div class="shcode"><pre class="shcode">php -r &quot;var_export(stream_isatty(STDERR));&quot;</pre>
</div></div>
<div class="example-contents"><p>以上例程的输出类似于:</p></div>
<div class="example-contents screen"><br />
true<br />
</div>
<div class="example-contents"><div class="shcode"><pre class="shcode">php -r &quot;var_export(stream_isatty(STDERR));&quot; 2&gt;output.txt</pre>
</div></div>
<div class="example-contents"><p>以上例程的输出类似于:</p></div>
<div class="example-contents screen"><br />
false<br />
</div>
</div>
</p>
</div>
</div></div></div></body></html>