How to get only the version of mcrypt in PHP?

1.7k views Asked by At

phpinfo() shows:

several info...
mcrypt support  enabled
mcrypt_filter support   enabled
Version     2.5.8
several info...

But how can I get ONLY the version of MCRYPT?

For example:

echo phpversion('intl');

or:

gd_info()['GD Version'];

I searched Google but could not find an answer, and phpinfo() is a lot of info.

1

There are 1 answers

0
Lenny Markus On

PHP has a built-in function called phpversion. [ DOCUMENTATION ]

This function allows you to retrieve the version of an installed extension. You'd use it like so:

<?php
// prints e.g. 'Current PHP version: 4.1.1'
echo 'Current PHP version: ' . phpversion();

// prints e.g. '2.5.8' or nothing if the extension isn't enabled
echo phpversion('mcrypt');
?>