Posted on February 26, 2013In some situations one wants to sort an array by key but PHP's
ksort()function sorts case-sensitive which is not always what you want. The result of ksort is an order like A < C < b instead of A < b < C. PHP 5.4.0 has introduced the
SORT_FLAG_CASEflag to sort case-insensitive. This article shows two simple implementations to get the same functionalityIf in PHP 5.2 or 5.3 .