PHP code example of ixnode / php-dsn-parser

1. Go to this page and download the library: Download ixnode/php-dsn-parser 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/ */

    

ixnode / php-dsn-parser example snippets


use Ixnode\PhpDsnParser\DsnParser;

$dsnParser = new DsnParser('smtp://suserweb:S22jD7Po%.,/[email protected]:25?verify_peer=0');

print_r($dsnParser->getParsed());
// (array) [
//     'protocol' => 'smtp',
//     'user' => 'suserweb',
//     'password' => 'S22jD7Po%.,/zu34k',
//     'host' => 'mail.domain.tld',
//     'port' => 25,
//     'options' => 'verify_peer=0',
// ]
bash
composer 
bash
vendor/bin/php-dsn-parser -V
bash
php-dsn-parser 0.1.0 (03-07-2023 01:17:26) - Björn Hempel <[email protected]>
bash
git clone [email protected]:ixnode/php-dsn-parser.git && cd php-dsn-parser