Welcome Guest, Not a member yet? Register   Sign In
Binary option for array_sort_by_multiple_keys?

(This post was last modified: 11-27-2022, 11:18 PM by bassmandc. Edit Reason: Edited to add note about a less-than-ideal workaround, and fixed function name typo. )

I'm using the array_sort_by_multiple_keys function and finding that capital letters take order precedence over lowercase letters.  For example, "AZ Systems" comes before "Abracadabra," despite "Z" being after "b" alphabetically.  In an SQL query, this can be addressed with "ORDER BY column, binary(column) ASC".  Is there a way to address it using the array_sort_by_multiple_keys function?

NOTE:  I'm accomplishing this for the time being by running a foreach loop where I convert the text being alphabetized to lowercase, add it to the array with a different key, and then sort by that key.  I'd just love to skip the extra processing and extra array data if possible.

EDIT:  Accidentally left "_keys" off the end in the OP.

Do you mean array_sort_by_multiple_keys()?

PHP Code:

(This post was last modified: 11-27-2022, 11:21 PM by bassmandc.)

Yes Kenjis - I meant array_sort_by_multiple_keys - bad copy and paste on my part.  I've corrected it.  Thanks for the reply - I'll try it out!

Theme © iAndrew 2016 - Forum software by © MyBB