Deprecated: The each() function is deprecated. This message will be suppressed on further calls in /home/zhenxiangba/zhenxiangba.com/public_html/phproxy-improved-master/index.php on line 456
PHP: posix_uname - Manual
[go: Go Back, main page]

PHP
downloads | documentation | faq | getting help | mailing lists | reporting bugs | php.net sites | links | conferences | my php.net

search for in the

正規表現(regex)関数 (POSIX拡張サポート)" width="11" height="7"/> <posix_ttyname
Last updated: Thu, 31 May 2007

view this page in

posix_uname

(PHP 4, PHP 5)

posix_uname — システム名を得る

説明

array posix_uname ( void )

システムについての情報を取得します。

POSIX では、値のフォーマットに関して何の仮定も設けないことを規定しています。 例えば、バージョン番号が 3 桁の数字であることや、 この関数により返されるその他のものに依存してはいけません。

返り値

システムに関する情報を文字列の連想配列として返します。 連想配列のキーは、次のようになります。

  • sysname - オペレーティングシステムの名前 (例 Linux)
  • nodename - システムの名前 (例 valiant)
  • release - オペレーティングシステムのリリース (例 2.2.10)
  • version - オペレーティングシステムのバージョン (例 #4 Tue Jul 20 17:01:36 MEST 1999)
  • machine - システムアーキテクチャ (例 i586)
  • domainname - DNS ドメイン名 (例 example.com)

domainname は、GNU の拡張機能で POSIX.1 には含まれていません。 このため、このフィールドは GNU システム上または GNU libc を使用している場合にのみ使用可能です。

例 1840. posix_uname() の使用例

<?php
$uname
=posix_uname();
print_r($uname);
?>

上の例の出力は、たとえば 以下のようになります。


Array
(
    [sysname] => Linux
    [nodename] => funbox
    [release] => 2.6.20-15-server
    [version] => #2 SMP Sun Apr 15 07:41:34 UTC 2007
    [machine] => i686
)

    



add a note add a note User Contributed Notes
posix_uname
boards at gmail dot com
30-Jan-2006 02:24
Or, a simpler way to do that:

<?php
print_r
(posix_uname());
?>

Should print something like:

Array
(
    [sysname] => Linux
    [nodename] => vaio
    [release] => 2.6.15-1-686
    [version] => #2 Tue Jan 10 22:48:31 UTC 2006
    [machine] => i686
)
sean at thedesignpeople dot com
10-Aug-2004 12:39
A simple example of how to loop thru and display the results of the posix_uname() function...

<?php
foreach(posix_uname() AS $key=>$value) {
    print
$key .": ". $value ."<br>";
}
?>

The procedure above should return something similar to the following results:

sysname: Linux
nodename: node1
release: 2.4.26
version: #6 Mon Jun 14 19:07:27 PDT 2004
machine: i686

 
show source | credits | sitemap | contact | advertising | mirror sites