If these are installed via PEAR, the following code will do the trick. It works by querying the PEAR registry to determine if the driver packages were installed. It will also display the version of each of those drivers.
require 'PEAR/Registry.php';
$reg = new PEAR_Registry;
$drivers = array (
'MDB2_Driver_fbsql',
'MDB2_Driver_ibase',
'MDB2_Driver_mssql',
'MDB2_Driver_mysql',
'MDB2_Driver_mysqli',
'MDB2_Driver_oci8',
'MDB2_Driver_odbc',
'MDB2_Driver_pgsql',
'MDB2_Driver_querysim',
'MDB2_Driver_sqlite',
'MDB2_Driver_sqlsrv',
);
foreach ($drivers as $driver) {
$pkg = $reg->getPackage($driver);
if (!is_null($pkg)) {
$version = $pkg->getVersion();
echo "$driver v$version installed\n";
}
}
This is based on a snippet of code I posted to https://gist.github.com/kenguest/1671361 last year.