Microsoft Word - Core PHP Programming Using PHP to Build Dynamic Web Sites

(singke) #1

string ldap_dn2ufn(string dn)


The ldap_dn2ufn translates a DN into a more user-friendly form, with type specifiers
stripped.


<?


$dn = "cn=John Smith, dc=php, dc=net";
print(ldap_dn2ufn($dn));
?>


integer ldap_errno(integer link)


The ldap_errno function returns the error number for the last error on a connection.


string ldap_error(integer link)


The ldap_error function returns a description of the last error on a connection.


string ldap_err2str(integer error)


Use ldap_err2str to convert an error number to a textual description.


array ldap_explode_dn(string dn, boolean attributes)


The ldap_explode_dn function splits a DN returned by ldap_get_dn into an
array. Each element is a Relative Distinguished Name, or RDN. The array contains an
element indexed by count that is the number of RDNs. The attributes argument
specifies whether values are returned with their attribute codes.


<?


//set test DN
$dn = "cn=Leon Atkinson, o=Clear Ink, c=US";


$rdn = ldap_explode_dn($dn, FALSE);


for($index = 0; $index < $rdn["count"]; $index++)
{
print("$rdn[$index]
\n");
}
?>

Free download pdf