ldap_bind

PHP 4, PHP 5, PHP 7, PHP 8
ldap_bind - Bind to LDAP directory
Manual
Code Examples

ldap_bind( LDAP\Connection$ldap, [string|null$dn = null], [string|null$password = null] ): bool

Binds to the LDAP directory with specified RDN and password.

Parameters

ldap

An LDAP\Connection instance, returned by ldap_connect.

dn

password

If password is not specified or is empty, an anonymous bind is attempted. The dn can also be left empty for an anonymous bind. This is defined in https://tools.ietf.org/html/rfc2251#section-4.2.2

Return Values

Returns true on success or false on failure.

Changelog

Version Description
8.1.0 The ldap parameter expects an LDAP\Connection instance now; previously, a resource was expected.

Related Functions

Example of ldap_bind

Show all examples for ldap_bind

PHP Version: