ldap_delete

bool ldap_delete(resource connectionID, string DN) 

Removes an entry.

Returns:

TRUE on success; FALSE on error

Description:

Deletes an entry in the LDAP directory. The distinguished name (DN) needs to be known or obtained prior to using the function.

Availability:

UNIX/Linux, Windows

Version:

3+, 4+

Example:

Delete an entry
$ldapconn = ldap_connect($host); 
$bind = ldap_bind($ldapconn, "cn=Sysadmin,dc=foo,dc=com", "secret"); 
$dn = "uid=jdoe,ou=People,dc=foo,dc=com"; 
if (!(ldap_delete($ldapconn, "$dn"))) {
    echo "unable to delete $dn\n"; 
} 

Get PHP Functions Essential Reference now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.