PHP - 函数:ldap_list()

PHP - 函数:ldap_list(),第1张

PHP - 函数:ldap_list() LDAP 目录协议函数库
ldap_list

列出简表。

语法: int ldap_list(int handle, string base_dn, string filter, array [attributes]);

返回值: 整数

函数种类: 网络系统

本函数用来列出单层 (One Level) 的资料,实际上它等于ldap_searchldap_search(),只是将值域改成 LDAP_SCOPE_ONELEVEL,本函数作用有点像 DOS 的 dir 或是 UNIX 的 ls。参数 handle 为打开 LDAP 的代号。参数 base_dn 为最基本的 dn 条件值,例如包括 o 和 c 二字段。参数 filter 为布尔条件,它的语法可以在 Netscape 站上找一份 dirsdkpg.pdf 文件,其中的 Search Syntax 一部份有详细的说明。参数 attributes 可省略,用来配置更细的列出属性。 使用范例

这个范例为片段程序

?php
$basedn = "o=SuperPHP Company, c=TW";
$justthese = array("ou");
$sr=ldap_list($ds, $basedn, "ou=*", $justthese);
$info = ldap_get_entries($ds, $sr);
for ($i=0; $i $info["count"]; $i++) {
 echo $info[$i]["ou"][0] ;
}
? 参考

ldap_read()  ldap_search()  


欢迎分享,转载请注明来源:内存溢出

原文地址: https://outofmemory.cn/zaji/3004378.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-09-27
下一篇 2022-09-27

发表评论

登录后才能评论

评论列表(0条)

保存