phpversion

(PHP 4, PHP 5)

phpversion — Gets the current PHP version

Описание

string phpversion ([ string $extension ] )

Returns a string containing the version of the currently running PHP parser or extension.

Список параметров

extension

An optional extension name.

Возвращаемые значения

If the optional extension parameter is specified, phpversion() returns the version of that extension, or FALSE if there is no version information associated or the extension isn't enabled.

Примеры

Пример #1 phpversion() example

<?php
// prints e.g. 'Current PHP version: 4.1.1'
echo 'Current PHP version: ' phpversion();

// prints e.g. '2.0' or nothing if the extension isn't enabled
echo phpversion('tidy');
?>

Примечания

Замечание: This information is also available in the predefined constant PHP_VERSION.

Коментарии

To know, what are the {php} extensions loaded & version of extensions :

<?php
foreach (get_loaded_extensions() as $i => $ext)
{
   echo 
$ext .' => 'phpversion($ext). '<br/>';
}
?>
2010-10-29 03:39:29
http://php5.kiev.ua/manual/ru/function.phpversion.html
Автор:
If you're trying to check whether the version of PHP you're running on is sufficient, don't screw around with `strcasecmp` etc.  PHP already has a `version_compare` function, and it's specifically made to compare PHP-style version strings.

<?php
if (version_compare(phpversion(), '5.3.10''<')) {
   
// php version isn't high enough
}
?>
2013-05-08 11:45:11
http://php5.kiev.ua/manual/ru/function.phpversion.html
Note that the version string returned by phpversion() may include more information than expected: "5.5.9-1ubuntu4.17", for example.
2016-07-14 23:38:39
http://php5.kiev.ua/manual/ru/function.phpversion.html

    Поддержать сайт на родительском проекте КГБ