ldap_get_option

(PHP 4 >= 4.0.4, PHP 5, PHP 7, PHP 8)

ldap_get_optionGet the current value for given option

说明

ldap_get_option(LDAP\Connection $ldap, int $option, array|string|int &$value = null): bool

Sets value to the value of the specified option.

返回值

成功时返回 true, 或者在失败时返回 false

更新日志

版本 说明
8.1.0 现在 ldap 参数接受 LDAP\Connection 实例,之前接受有效的 ldap link resource

示例

示例 #1 Check protocol version

<?php
// $ds is a valid LDAP\Connection instance for a directory server
if (ldap_get_option($ds, LDAP_OPT_PROTOCOL_VERSION, $version)) {
echo
"Using protocol version $version\n";
} else {
echo
"Unable to determine protocol version\n";
}
?>

注释

注意:

This function is only available when using OpenLDAP 2.x.x OR Netscape Directory SDK x.x.

参见

add a note

User Contributed Notes

There are no user contributed notes for this page.
To Top