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

98 lines
3.6 KiB
HTML

<!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>Get system name</title>
</head>
<body class="docs"><div id="layout">
<div id="layout-content"><div id="function.posix-uname" class="refentry">
<div class="refnamediv">
<h1 class="refname">posix_uname</h1>
<p class="verinfo">(PHP 4, PHP 5, PHP 7)</p><p class="refpurpose"><span class="refname">posix_uname</span> &mdash; <span class="dc-title">Get system name</span></p>
</div>
<div class="refsect1 description" id="refsect1-function.posix-uname-description">
<h3 class="title">说明</h3>
<div class="methodsynopsis dc-description">
<span class="methodname"><strong>posix_uname</strong></span>
( <span class="methodparam">void</span>
) : <span class="type">array</span></div>
<p class="para rdfs-comment">
Gets information about the system.
</p>
<p class="para">
Posix requires that assumptions must not be made about the
format of the values, e.g. the assumption that a release may contain
three digits or anything else returned by this function.
</p>
</div>
<div class="refsect1 returnvalues" id="refsect1-function.posix-uname-returnvalues">
<h3 class="title">返回值</h3>
<p class="para">
Returns a hash of strings with information about the
system. The indices of the hash are
<ul class="itemizedlist">
<li class="listitem"><span class="simpara">
sysname - operating system name (e.g. Linux)
</span></li>
<li class="listitem"><span class="simpara">
nodename - system name (e.g. valiant)
</span></li>
<li class="listitem"><span class="simpara">
release - operating system release (e.g. 2.2.10)
</span></li>
<li class="listitem"><span class="simpara">
version - operating system version (e.g. #4 Tue Jul 20
17:01:36 MEST 1999)
</span></li>
<li class="listitem"><span class="simpara">
machine - system architecture (e.g. i586)
</span></li>
<li class="listitem"><span class="simpara">
domainname - DNS domainname (e.g. example.com)
</span></li>
</ul>
</p>
<p class="para">
domainname is a GNU extension and not part of POSIX.1, so this
field is only available on GNU systems or when using the GNU
libc.
</p>
</div>
<div class="refsect1 examples" id="refsect1-function.posix-uname-examples">
<h3 class="title">范例</h3>
<p class="para">
<div class="example" id="example-4356">
<p><strong>Example #1 Example use of <span class="function"><strong>posix_uname()</strong></span></strong></p>
<div class="example-contents">
<div class="phpcode"><pre><span style="color: #000000">
<span style="color: #0000BB">&lt;?php<br />$uname</span><span style="color: #007700">=</span><span style="color: #0000BB">posix_uname</span><span style="color: #007700">();<br /></span><span style="color: #0000BB">print_r</span><span style="color: #007700">(</span><span style="color: #0000BB">$uname</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">?&gt;</span>
</span>
</pre></div>
</div>
<div class="example-contents"><p>以上例程的输出类似于:</p></div>
<div class="example-contents screen">
<div class="cdata"><pre>
Array
(
[sysname] =&gt; Linux
[nodename] =&gt; funbox
[release] =&gt; 2.6.20-15-server
[version] =&gt; #2 SMP Sun Apr 15 07:41:34 UTC 2007
[machine] =&gt; i686
)
</pre></div>
</div>
</div>
</p>
</div>
</div></div></div></body></html>