rmdir()

    boolean rmdir(string dn)
rmdir() deletes the specified directory (DN) and all of the attributes in that directory. rmdir() will fail if a directory contains subdirectories.

Example:

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