1. Go to this page and download the library: Download paweldecowski/ldap-dn 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/ */
use LdapDn\Dn;
use LdapDn\Rdn;
use LdapDn\Attribute;
$dn = new Dn([
new Rdn([new Attribute('dc', 'org')]),
new Rdn([new Attribute('dc', 'example')]),
new Rdn([new Attribute('ou', 'leadership')]),
new Rdn([new Attribute('ou', 'it')]),
new Rdn([new Attribute('cn', 'doe, john'), new Attribute('uid', '123')]),
]);
echo $dn; // 'cn=doe\, john+uid=123,ou=it,ou=leadership,dc=example,dc=org'
use LdapDn\Dn;
use LdapDn\Rdn;
use LdapDn\Attribute;
$dn = new Dn([
Rdn::withNameAndValue('dc', 'org'),
Rdn::withNameAndValue('dc', 'example'),
Rdn::withNameAndValue('ou', 'leadership'),
Rdn::withNameAndValue('ou', 'it'),
new Rdn([new Attribute('cn', 'doe, john'), new Attribute('uid', '123')]),
]);
echo $dn; // 'cn=doe\, john+uid=123,ou=it,ou=leadership,dc=example,dc=org'
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.