Re: ldap_sort function
| From: | Unknown Sender | Date: | Tue, 07 May 2002 21:18:19 +0000 |
| Subject: | Re: ldap_sort function | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-96486@lists.php.net to get a copy of this message | ||
On Wed, Apr 24, 2002 at 04:21:52PM -0300, Jean-Rene Cormier wrote:
> It's not documented in the manual yet and since I'm doing quite some
> LDAP stuff lately I think it would be useful so if anybody knows how to
> use it let me know.
>
> What I need is how do you define the "string sortfilter"? What's the
> syntax for that?
It's just one or more attributes (with the most significant attribute
first). I don't remember if you use , or just space between them. If
you want to sort on say cn, you can do something like:
$sr = ldap_search($ds, "dc=my-company,dc=com", "objectclass=*");
ldap_sort($ds, $sr, "cn");
$info = ldap_get_entries($ds, $sr);
ldap_sort() will then sort the sort result, and you access the data
just like normal, ldap_get_entries() is just one way.
Stig