In [ ]:
$url = parse_url('postgres://username:password@host:12345/database');

In [ ]: