Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
 
  • Explanation of php_uname

    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 223
    Comment on it

    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)

Sign In
                           OR                           
                           OR                           
Register

Sign up using

                           OR                           
Forgot Password
Fill out the form below and instructions to reset your password will be emailed to you:
Reset Password
Fill out the form below and reset your password: