If this parameter is disabled (set to 0) or omitted, both the attribute
types and their correspondinsg values are retrieved.
The next optional parameter, size_limit, can limit the number of entries retrieved.
If this parameter is disabled (set to 0) or omitted, no limit is set on the retrieval count. The
following example retrieves both the attribute types and corresponding values of
the first five users with first names beginning with A:
$results = ldap_search($connection, "dc=OpenLDAP,dc=Org", "givenName=A*", 0, 5);
Enabling the next optional parameter, time_limit, places a limit on the time, in
seconds, devoted to a search. Omitting or disabling this parameter (setting it to 0)
results in no set time limit, although such a limit can be (and often is) set within the
LDAP server configuration. The next example performs the same search as the previous
example, but limits the search to 30 seconds:
$results = ldap_search($connection, "dc=OpenLDAP,dc=Org", "givenName=A*", 0, 5,
30);
432 CHAPTER 17 ?– PHP AND LDAP
The eighth and final optional parameter, deref, determines how aliases are
handled. Aliases are out of the scope of this chapter, although you??™ll find plenty of
information about the topic online.
Doing Something with Returned Records
Once one or several records have been returned from the search operation, you??™ll
probably want to do something with the data, either output it to the browser or perform
other actions.
Pages:
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512