note 74035 modified in function.ldap-sort by bobby
| From: | bobby@php.net | Date: | Wed, 21 Mar 2007 16:42:22 +0000 |
| Subject: | note 74035 modified in function.ldap-sort by bobby | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-124679@lists.php.net to get a copy of this message | ||
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.
--was--
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.
http://php.net/manual/en/function.ldap-sort.php