Home >Backend Development >PHP Tutorial >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 '<br>'; $s = php_uname('s'); print_r($s); echo '<br>'; $n = php_uname('n'); print_r($n); echo '<br>'; $r = php_uname('r'); print_r($r); echo '<br>'; $v = php_uname('v'); print_r($v); echo '<br>'; $m = php_uname('m'); 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!