Jump to content

Recommended Posts

Umm I want to sort an array twice.

First alphabetically

than numerically.

I tried

sort($arry);

But that just sorts it numerically.

given me the output

HM02,HM03,HM04,HM05,TM01,TM02,TM04,TM05,TM07,TM11,TM12,TM13,TM14,TM15,TM16,TM17,TM18,TM19,TM23,TM24,TM25,TM26,TM27,TM28,TM29,TM30,TM35,TM36,TM37,TM38,TM39,TM40,TM41,TM42,TM43,TM45,TM46,TM47,TM48,TM49,HM01,TM03,TM06,TM08,TM09,TM10,TM20,TM21,TM22,TM31,TM32,TM33,TM34,TM44,TM50

So as you can see there's mixing between HM and TM I want them both seperate.

Any body know how i can do that?

Link to comment
https://forums.phpfreaks.com/topic/51510-solved-php-array-sort/
Share on other sites

Can you show some more of the code (e.g. creating the array, sorting and printing). What you are showing doesn't make sense. You should not be getting the results you state. I took the values you have above, mixed them up, applied sort to the array, and I am getting expected results.

Link to comment
https://forums.phpfreaks.com/topic/51510-solved-php-array-sort/#findComment-253681
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.