rmdir()

rmdir() deletes the specified directory (DN) and all of the attributes in that directory. rmdir() will fail if a directory contains subdirectories. To delete an entire tree of entries, use the rmrf() function.

Example:

$ldap = new LDAP();
$ldap->rm("cn=Bob Vila, ou=people, dc=ypass, dc=net");