php_uname function is used in php for getting information about the operating system ,host name, release name, version information and machine type.This method is used in php for returning a description of the current operating system in which you are running your php code. It will give you whole information about the name and configuration of the operating system.
Syntax:
string php_uname ([ string $mode = "a" ] )
Source Code
<?php
echo php_uname();
echo PHP_OS;
if (strtoupper(substr(PHP_OS, 0, 3)) === 'WIN') {
echo 'This is a server using Windows!';
} else {
echo 'This is a server not using Windows!';
}
?>
Output:
Linux shristinawani 3.16.0-30-generic #40~14.04.1-Ubuntu SMP Thu Jan 15 17:43:14 UTC 2015 x86_64This is a server not using Windows!
0 Comment(s)