Overview
KB
Technical FAQ
PHP Manual
CSS2 Manual
HTML Manual
JS Guide
JS Reference
PhpDock Manual
Nu-Coder Manual
PhpExpress Manual
PHP Joomla
Development
Learn PHP
 
<ldap_exop_whoamildap_first_attribute>
^LDAP FunctionsLast updated: Mon, 26 Oct 2026

ldap_explode_dn

(PHP 4, PHP 5, PHP 7, PHP 8)

ldap_explode_dn — Splits DN into its component parts

Description

function ldap_explode_dn(string $dn, int $with_attrib): array|false

Splits the DN returned by ldap_get_dn() and breaks it up into its component parts. Each part is known as Relative Distinguished Name, or RDN.

Parameters

dn

The distinguished name of an LDAP entity.

with_attrib

Used to request if the RDNs are returned with only values or their attributes as well. To get RDNs with the attributes (i.e. in attribute=value format) set with_attrib to 0 and to get only values set it to 1.

Return Values

Returns an array of all DN components, or false on failure. The first element in the array has count key and represents the number of returned values, next elements are numerically indexed DN components.


<ldap_exop_whoamildap_first_attribute>
^LDAP FunctionsLast updated: Mon, 26 Oct 2026