check php version cmd code example

Example 1: php get version

echo PHP_VERSION;

Example 2: checking php version

<?php
echo 'PHP version: ' . phpversion();
?>

Example 3: how to get php version in xampp

Open command prompt
Locate directory using cd C:/Xampp/php
Type command php -v
You will get your php version details

Example 4: check php version

/* in terminal type it*/
php -v

Example 5: how to check php version in php

<?php
  echo 'PHP version:' . phpinfo();
?>

Example 6: how to cheeck php

<?phpphpinfo(); ?>

Tags:

Php Example