©
이 문서에서는 PHP 중국어 웹사이트 매뉴얼 풀어 주다
(PHP 4, PHP 5)
ldap_next_entry — Get next result entry
$link_identifier
, resource $result_entry_identifier
)
Retrieve the entries stored in the result. Successive calls to the
ldap_next_entry() return entries one by one till there
are no more entries. The first call to ldap_next_entry()
is made after the call to ldap_first_entry() with the
result_entry_identifier
as returned from the
ldap_first_entry() .
link_identifier
An LDAP link identifier, returned by ldap_connect() .
result_entry_identifier
Returns entry identifier for the next entry in the result whose entries
are being read starting with ldap_first_entry() . If
there are no more entries in the result then it returns FALSE
.
[#1] me at xbug dot de [2014-07-17 10:13:31]
This is working for me in php 5.5:
<?php
$ldap_host = 'ldap://ldap.example.com';
$base_dn = "ou=users,dc=example,dc=com";
$connect = ldap_connect($ldap_host);
$result = ldap_search($connect, $base_dn, "(cn=*)");
$entry = ldap_first_entry($connect, $result);
do {
$dn = ldap_get_dn($connect, $entry);
echo "DN is $dn\n";
} while ($entry = ldap_next_entry($connect, $entry));
ldap_close($connect);
?>