NAVEED NAVEED - 1 year ago 140
PHP Question

PHP: How to sort values of an array in alphabetical order?

I want to sort values of an array in alphabetical order in PHP. If all values started with same character then they should be sorted using second character and so on. Ignore case sensitive.

For Example:

values[0] = "programming";
values[1] = "Stackoverflow";
values[2] = "question";
values[3] = "answers";
values[4] = "AA Systems";

values[0] = "AA Systems";
values[1] = "answers";
values[2] = "programming";
values[3] = "question";
values[4] = "Stackoverflow";

I have found some algorithms but I want a way that is fast and with small number of statements. Ignoring case sensitive is special for me. Thanks.

Answer Source


Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download