Somebody recently asked me how to print the PHP version from within the PHP script. The answer is very simple and requires only two words to print the PHP version. Here is the script
PHP_VERSION is a predefined constant. It contains the value of the PHP version.
A sample output is as follows.
[sudheer@localhost cli]$ php php_version.php 5.2.6 [sudheer@localhost cli]$