getParentDir()
string getParentDir([string dn])
If a DN is not passed, this function will return the DN/path of the parent
directory of the current working directory. If a DN is passed, it returns
the parent directory of the DN specified.
Example:
$ldap = new LDAP();
$ldap->cd("cn=Eric, ou=people, dc=ypass, dc=net");
if ($ldap->getParentDir() == "ou=people, dc=ypass, dc=net")
echo "It worked.";
else
echo "It didn't work.";
/* The following two function calls have the same effect */
$ldap->cd("..");
$ldap->cd($ldap->getParentDir());
|