Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8454961
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T12:09:46+00:00 2026-06-10T12:09:46+00:00

PHP 5.4 introduces the useful SORT_FLAG_CASE for making any other search case insensitive. Unfortunately

  • 0

PHP 5.4 introduces the useful SORT_FLAG_CASE for making any other search case insensitive. Unfortunately this isn’t available in PHP 5.3 or less and so I was wondering how the following array:

array('a'=>2,'b'=>4,'A'=>1,'B'=>3);

Could be sorted into:

array('A'=>1,'a'=>2,'B'=>3,'b'=>4);

As the usual ksort() function sorts it as:

array('A'=>1,'B'=>3,'a'=>2,'b'=>4);
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-10T12:09:48+00:00Added an answer on June 10, 2026 at 12:09 pm

    A comment on one of the PHP function reference pages pointed me to the uksort() function; this (and the uasort() function for sorting by value instead of key) allow the comparison algorithm for shifting in the quick sort to be written by the user.

    Combine this with the very simple strcasecmp() function (which compares two strings and returns <0 for a>b and >0 for a>b) gives you:

    uksort($array, 'strcasecmp');
    

    To easily achieve the effect of:

    ksort($array,SORT_STRING | SORT_FLAG_CASE);
    

    In PHP 5.3 or less.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I use PHP 5.3, which introduces closures. Because I now have closures available throughout
PHP code: echo date(c); //out put like this 2012-06-19T20:37:44+05:30 echo date(d M, Y); //out
PHP's mkdir returns false on failure. Failure can be: Folder already exists Some other
PHP experts, I've been working on this problem for about a day and a
I'm working through this tutorial: http://www.killerphp.com/tutorials/object-oriented-php/php-objects-page-3.php At first he has you create a setter
PHP 5 introduces the magic method __get() and __set(). From my understanding it is
I get this error: PHP Fatal error: Call to undefined function mb_strpos() in /my/file.php
I need to introduce JavaScript alert function show_alert() inside PHP code. How this can
I come from PHP environment where several frameworks introduces ACL classes, should I just
Are there any PHP ORM projects which supports MySQL and NoSQL databases such as

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.