note 74035 added to function.ldap-sort
| From: | (hyphen) | Date: | Wed, 21 Mar 2007 16:38:28 +0000 |
| Subject: | note 74035 added to function.ldap-sort | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-124677@lists.php.net to get a copy of this message | ||
Further to my previous post I found out why my ldap_sort didn't seem to be working properly.
It's because ldap_sort is case sensitive so although I was converting all my email addresses
into lower case before echoing them display, the contents of the ldap results array were in mixed
case in the result array - so sorting these resulted in a list of A-Z then the next part of the list
was a-z.
I'm not sure if there's a way to make ldap_sort case insensitive, so I'm sticking
with Ben's solution with the following amendment.
<?php
...
$a .= strtolower($entries[$j-1][$attrib][0]);
$b .= strtolower($index[$attrib][0]);
...
?>
Hope it's useful.
----
Server IP: 194.145.210.4
Probable Submitter: 80.169.172.95
----
Manual Page -- http://www.php.net/manual/en/function.ldap-sort.php
Edit -- https://master.php.net/note/edit/74035
Del: integrated -- https://master.php.net/note/delete/74035/integrated
Del: useless -- https://master.php.net/note/delete/74035/useless
Del: bad code -- https://master.php.net/note/delete/74035/bad+code
Del: spam -- https://master.php.net/note/delete/74035/spam
Del: non-english -- https://master.php.net/note/delete/74035/non-english
Del: in docs -- https://master.php.net/note/delete/74035/in+docs
Del: other reasons-- https://master.php.net/note/delete/74035
Reject -- https://master.php.net/note/reject/74035
Search -- https://master.php.net/manage/user-notes.php