xPDO.parseDSN
Last updated not available | Page history | Improve this page | Report an issue
Support the team building MODX with a monthly donation.
The budget raised through OpenCollective is transparent, including payouts, and any contributor can apply to be paid for their work on MODX.
Backers
Budget
$185 per month—let's make that $500!
Learn morexPDO::parseDSN¶
Parses a PDO DSN string into an associative array with driver, host, database, and charset keys. This is useful because some xPDO methods, such as xPDOManager::createSourceContainer(), expect the parsed array rather than the raw DSN string.
Syntax¶
array|null parseDSN (string $string)
Example¶
$dsn = 'mysql:host=localhost;dbname=mydb;charset=utf8';
$parts = xPDO::parseDSN($dsn);
// array('driver' => 'mysql', 'host' => 'localhost',
// 'database' => 'mydb', 'charset' => 'utf8')
See Also¶
Support the team building MODX with a monthly donation.
The budget raised through OpenCollective is transparent, including payouts, and any contributor can apply to be paid for their work on MODX.
Backers
Budget
$185 per month—let's make that $500!
Learn more










