ldap_next_entry

string ldap_next_entry(resource connectionID, int result) 
connectionID Connection ID
result Entry ID

Fetches the next entry.

Returns:

Next entry ID string; FALSE on failure

Description:

Advances to the next entry using the entry ID assigned from ldap_first_entry(). FALSE is returned if there are no more entries to return.

Availability:

UNIX/Linux, Windows

Version:

3+, 4+

Example:

Loop through entries
$result = ldap_search($ldap_conn, "dc=foo,dc=com", $filter); 
$entry = ldap_first_entry($ldap_conn, $result); 
while ($entry) {
   $dn = ldap_dn2ufn(ldap_get_dn($ldap_conn, $entry)); 
   echo "DN is $dn\n"; 
   $entry = ldap_next_entry($ldap_connection, $entry); 
} 

Get PHP Functions Essential 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.