$version = phpversion();
print $version;
However, for best practice, I would use the constant PHP_VERSION
. No function overhead, and cleaner IMO.
Also, be sure to use version_compare()
if you are comparing PHP versions for compatibility.
$version = phpversion();
print $version;
However, for best practice, I would use the constant PHP_VERSION
. No function overhead, and cleaner IMO.
Also, be sure to use version_compare()
if you are comparing PHP versions for compatibility.