Getting the version of php running



Getting & setting PHP values of php.ini and getting server, operating system & PHP details to Manage


Many time we will be interested in knowing what is the version of php running at our server. This information is available in php info file. But we can't use the value of php version by taking it from php info , so we will be using a constant PHP_VERSION to know the details about php running at the server.
<?Php
echo PHP_VERSION;
?>
Output ( may change based on your PHP version )
5.6.15

phpversion()

echo phpversion();
Output
5.6.15

version_compare()

version_compare(version1,version2,operator)
It returns -1 if the first version is lower than the second, 0 if they are equal, and 1 if the second is lower.
if (version_compare(PHP_VERSION, '5.3.0') >= 0) {
    echo 'I am at lower PHP version 5.3.0, my version: ' . PHP_VERSION;
}
Output
I am at lower PHP version 5.3.0, my version: 5.6.15
How to know MySQL Version?

how to check mysql support in php by using phpinfo

how to check MSSQL support in php by using phpinfo

how to check GD Support in php by using phpinfo


php_uname() Introduction to PHP Collect all PHP settings by phpinfo() Guide to installation and How to write our first PHP Script

Subscribe to our YouTube Channel here

Subscribe

* indicates required
Subscribe to plus2net

    plus2net.com







    admin

    23-12-2009

    this site is nice
    murugan

    18-02-2010

    i like php
    varunkumar

    03-04-2010

    I love plus2net.... This help me lot...
    Techie Talks

    27-07-2010

    You can always use which displays a more detailed information about your PHP.
    Yogesh

    11-05-2012

    I like php plus2net lot of examle

    Post your comments , suggestion , error , requirements etc here




    We use cookies to improve your browsing experience. . Learn more
    HTML MySQL PHP JavaScript ASP Photoshop Articles FORUM . Contact us
    ©2000-2022 plus2net.com All rights reserved worldwide Privacy Policy Disclaimer