How to get the list of all ODBC data sources available in my windows pc using PHP. I have tried using the below code. But getting empty. Could you please help.
define('HKEY_LOCAL_MACHINE', 0x80000002);
$computer = '.';
$reg = new COM("winmgmts:{impersonationLevel=impersonate}\\\\" . $computer . "\oot\\default:StdRegProv");
$key_path = 'SOFTWARE\ODBC\ODBCINST.INI\ODBC Drivers';
$sub_keys = array();
$reg->EnumKey(HKEY_LOCAL_MACHINE, $key_path, $sub_keys);
foreach($sub_keys as $sub_key){
echo $sub_key;
}