LDAP Functions

The following functions are used to communicate with a Lightweight Directory Access Protocol (LDAP) server. See http://www.openldap.org for a PHP-compatible free LDAP implementation.

int ldap_add(int link, string dn, array entry)

Add entries to an LDAP directory

int ldap_bind(int link [, string dn, string password])

Bind to an LDAP directory

int ldap_close(int link)

Alias for ldap_unbind( )

int ldap_connect([string host [, int port]])

Connect to an LDAP server

int ldap_count_entries(int link, int result)

Count the number of entries in a search result

int ldap_delete(int link, string dn)

Delete an entry from a directory

string ldap_dn2ufn(string dn)

Convert a distinguished name to a user friendly naming format

string ldap_err2str(int errno)

Convert error number to error string

int ldap_errno(int link)

Get the current LDAP error number

string ldap_error(int link)

Get the current LDAP error string

array ldap_explode_dn(string dn, int with_attrib)

Split a distinguished name into its component parts

string ldap_first_attribute(int link, int result, int ber)

Return the first attribute

int ldap_first_entry(int link, int result)

Return the first result ID

int ldap_free_result(int result)

Free result memory

array ldap_get_attributes(int link, int result)

Get attributes from a search result entry

string ldap_get_dn(int link, int result)

Get the distinguished name of a result entry

array ldap_get_entries(int link, int result)

Get all result entries

array ldap_get_values(int link, int result, string attribute) ...

Get PHP Pocket 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.