1. Description
php_uname — Returns information about the system running PHP.
Prototype: string php_uname ([ string $mode = “a” ] ). Returns a description of the operating system running php, which is the same string output at the top of phpinfo(). If you just want to get the name of the operating system. Consider using the constant PHP_OS, but be aware that this constant will contain the name of the operating system when PHP was built.
2. Parameter
mode is a single character used to define what information is to be returned:
3. Example
<code><span><?php</span><span>$sys_info</span> = php_uname() . <span>"\n"</span>; <span>if</span>(strtolower(substr(<span>$sys_info</span>,<span>0</span>,<span>5</span>)) == <span>"linux"</span>) { <span>echo</span><span>"this is a linux system.\n"</span>; } <span>echo</span><span>"Host: "</span> . php_uname(<span>'n'</span>) . <span>"\n"</span>; <span>?></span></code>
The above has introduced the php_uname function, including aspects of it. I hope it will be helpful to friends who are interested in PHP tutorials.