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

(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.
Reply


Messages In This Thread
Binary option for array_sort_by_multiple_keys? - by bassmandc - 11-27-2022, 07:49 PM



Theme © iAndrew 2016 - Forum software by © MyBB