Sorting LDAP Entries - Please Help
| From: | Jason Mowat | Date: | Wed, 07 Feb 2001 21:41:23 +0000 |
| Subject: | Sorting LDAP Entries - Please Help | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-38622@lists.php.net to get a copy of this message | ||
Greets all,
I have been playing around with LDAP sorting, but I can't seem to get it to
work. Essentially, I do an ldap_search() with a filter condition, and use a
ldap_get_entries() to get all of the results. The ldap_get_entries()
function returns a multi-dimensional array contain my result set. I am
assuming it looks something like this:
Entries = array(
"count" => x,
array(
array (
"sn" => "Mowat",
"givenname" => "Jason",
...
),
array (
"sn" => "Anderson",
"givenname" => "Peter",
...
),
array (
...
)
)
Now, I want to sort all of the internal "person" data by "sn". But, when I
try usort, it does not work. I have tried uasort as well. Basically, I
need to be able to sort a nested array without touching the outside arrays
based on a value in the nested array's element..
The examples I have seen on the 'Net don't seem to work (for me anyways). I
have even copied them verbatim, and I get the same results. I'm not sure if
their Entries array is the same as mine. Mine is the Entries returned from
ldap_get_entries().
Any help is appreciated!
Cheers,
Jason