Home >Backend Development >PHP Tutorial >Detailed explanation of the usage of php_uname in PHP

Detailed explanation of the usage of php_uname in PHP

coldplay.xixi
coldplay.xixiforward
2020-06-09 11:09:554123browse

Detailed explanation of the usage of php_uname in PHP

php_uname

Returns information about the system running PHP

Parameters

mode is a single character that defines what information to return:

'a': This is the default. Contains all patterns in the sequence "s n r v m".​ ​ ​

's': operating system name. For example: FreeBSD.​ ​ ​

'n': host name. For example: localhost.example.com.​ ​ ​

'r': Version name, for example: ​ ​ ​ 5.1.2-RELEASE.​ ​ ​

'v': version information. There are big differences between operating systems.​ ​ ​

'm': Machine type. For example: i386.

Example 1

$systemInfo = php_uname();
print_r($systemInfo);
输出
Windows NT DESKTOP-4645ELA 10.0 build 17134 (Windows 10) AMD64
示例二
$v = php_uname('a');
print_r($v);
 
echo &#39;<br>&#39;;
$s = php_uname(&#39;s&#39;);
print_r($s);
 
echo &#39;<br>&#39;;
$n = php_uname(&#39;n&#39;);
print_r($n);
 
echo &#39;<br>&#39;;
$r = php_uname(&#39;r&#39;);
print_r($r);
 
echo &#39;<br>&#39;;
$v = php_uname(&#39;v&#39;);
print_r($v);
 
echo &#39;<br>&#39;;
$m = php_uname(&#39;m&#39;);
print_r($m);

Output

Windows NT DESKTOP-4645ELA 10.0 build 17134 (Windows 10) AMD64
Windows NT
DESKTOP-4645ELA
10.0
build 17134 (Windows 10)
AMD64

Recommended tutorial: "PHP Video Tutorial"

The above is the detailed content of Detailed explanation of the usage of php_uname in PHP. For more information, please follow other related articles on the PHP Chinese website!

Statement:
This article is reproduced at:liqingbo.cn. If there is any infringement, please contact admin@php.cn delete