This is a simple PHP library for PDO connection
Install library via composer :
composer require adirona/pdo-connectionConnection class accepts 2 arrays in it's constructor first one is DSN settings and the second one is for connection options and third attribute is which PDO driver do you want to use for connection default is MYSQL. You can check PDO Drivers https://www.php.net/manual/en/pdo.drivers.php or using SupportedPDODatabaseDrivers() method
$DatabaseInstance = new Connection([
'host' => 'localhost',
'database_name' => 'db_name',
'username' => 'root',
'password' => '',
'charset' => 'utf8'
],[
PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION,
PDO::ATTR_DEFAULT_FETCH_MODE => PDO::FETCH_ASSOC,
PDO::ATTR_EMULATE_PREPARES => false,
], 'mysql');$ConnectDatabase = $DatabaseInstance->connect();To get most of this PDO wrapper and PDO in general use also this repository (https://github.com/envms/fluentpdo).