This library helps to parse DSN\URI strings.
useIxnode\PhpDsnParser\DsnParser;$dsnParser = newDsnParser('smtp://suserweb:S22jD7Po%.,/zu34k@mail.domain.tld: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',// ]composer require ixnode/php-dsn-parservendor/bin/php-dsn-parser -Vphp-dsn-parser 0.1.0 (03-07-2023 01:17:26) - Björn Hempel <bjoern@hempel.li>git clone git@github.com:ixnode/php-dsn-parser.git &&cd php-dsn-parsercomposer installcomposer testThis library is licensed under the MIT License - see the LICENSE file for details.