PHP code example of exileed / pdoparsedsn
1. Go to this page and download the library: Download exileed/pdoparsedsn library. Choose the download type require. 2. Extract the ZIP file and open the index.php. 3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
exileed / pdoparsedsn example snippets
php
$dsn = new \ExileeD\PDOParseDSN\DSN('mysql:host=127.0.0.1;port=3306;dbname=test_db');
$dsn->getProtocol(); // mysql
$dsn->getHost(); // 127.0.0.1
$dsn->getPort(); // 3306
$dsn->getDatabase(); // test_db