src/LdapTools/Utilities/LdapUtilities.php
public static function explodeExchangeLegacyDn($dn, $withAttributes = false)
    {
        preg_match(self::MATCH_LEGACY_DN, $dn, $matches);

        if (!isset($matches[2])) {
            throw new InvalidArgumentException(sprintf('Unable to parse legacy exchange dn "%s".', $dn));
        }
        $pieces = [];
        for ($i = 3; $i < count($matches); $i += 3) {
            $pieces[] = $withAttributes ? $matches[$i - 1].'='.$matches[$i] : $matches[$i];
        }

        return $pieces;
    }
public static function explodeExchangeLegacyDn($dn, $withAttributes = false)
    {
        preg_match(self::MATCH_LEGACY_DN, $dn, $matches);

        if (!isset($matches[2])) {
            throw new InvalidArgumentException(sprintf('Unable to parse legacy exchange dn "%s".', $dn));
        }
        $pieces = [];
        for ($i = 3; $i < count($matches); $i += 3) {
            $pieces[] = $withAttributes ? $matches[$i - 1].'='.$matches[$i] : $matches[$i];
        }

        return $pieces;
    }
public static function explodeExchangeLegacyDn ( $ dn , $ withAttributes = false ) { preg_match ( self :: MATCH_LEGACY_DN , $ dn , $ matches ) ; if ( ! isset ( $ matches [ 2 ] ) ) { throw new InvalidArgumentException ( sprintf ( 'Unable to parse legacy exchange dn "%s".' , $ dn ) ) ; } $ pieces = [ ] ; for ( $ i = 3 ; $ i < count ( $ matches ) ; $ i += 3 ) { $ pieces [ ] = $ withAttributes ? $ matches [ $ i - 1 ] . '=' . $ matches [ $ i ] : $ matches [ $ i ] ; } return $ pieces ; }
Converts an Exchange Legacy DN into its separate pieces.

@param string $dn
@param bool $withAttributes
@return array
Converts an Exchange Legacy DN into its separate pieces .