Get PHP's version in PHP

Description

The following code shows how to get PHP's version.

Example


<?php//  w  w  w. j  a v  a 2 s  .  co m
  if(PHP_VERSION < 5.0)
  {
    print('This script requires PHP 5 or better.');
    exit();
  }else{
      print('OK');
  }
?>

The code above generates the following result.





















Home »
  PHP Tutorial »
    Development »




Environment
Error
Hash
Include
Locale
Math
Network
Output
Reflection
PHP Regular Expressions