Detailed explanation of the usage of php_uname in PHP

coldplay.xixi
Release: 2023-04-08 20:18:01
forward
3900 people have browsed it

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 '
'; $s = php_uname('s'); print_r($s); echo '
'; $n = php_uname('n'); print_r($n); echo '
'; $r = php_uname('r'); print_r($r); echo '
'; $v = php_uname('v'); print_r($v); echo '
'; $m = php_uname('m'); print_r($m);
Copy after login

Output

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

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!

Related labels:
source:liqingbo.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact [email protected]
Latest Issues
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!