echo PHP_VERSION;
/* in terminal type it*/ php -v
<?php echo 'PHP version: ' . phpversion(); ?>
<?php echo 'PHP version:' . phpinfo(); ?>
$ php -v