Getting PHP Version

Discussion in 'PHP' started by aenigma, Oct 6, 2004.

  1. #1
    Is it possible to obtain the PHP Version runtime? I mean somthing to make a code like this:

    
    if ($phpVersion > 4.3) {
      doSomething
    } else {
      doSomethingElse
    }
    
    Code (markup):
    So I could wirite a code that would use some things if they are present, and my code would be more portable.
     
    aenigma, Oct 6, 2004 IP
  2. T0PS3O

    T0PS3O Feel Good PLC

    Messages:
    13,219
    Likes Received:
    777
    Best Answers:
    0
    Trophy Points:
    0
    #2
    <?php
    phpinfo();
    ?>

    Shows the version. Have a look on php.net to see whether it can return the version as the output to use in statements.

    Actually, yuor answer seems to be here: http://uk2.php.net/manual/en/function.phpversion.php

    Just evaluate the string in a comparison.
     
    T0PS3O, Oct 6, 2004 IP
  3. aenigma

    aenigma Peon

    Messages:
    42
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Thanks this is what I was searching.
     
    aenigma, Oct 6, 2004 IP