Jump to content

Array sorting


tobeyt23

Recommended Posts

I have an array with a key shortname. I need to sort the array by sortname in a specific order how can I accomplish this? for Example I need shortname order like this (What, Bob, Jake, How).

 

I still don't understand what the "specific order" is? 

 

I don't see any type of sort in:  (What, Bob, Jake, How)

Link to comment
https://forums.phpfreaks.com/topic/151389-array-sorting/#findComment-795148
Share on other sites

Here is the array, I want the shortname not to be alpha but in an order i set such as b,a,c or c,a,b or b,c,a

 

Array
(
    [0] => Array
        (
            [orderId] => 269
            [shortName] => a
        )

    [1] => Array
        (
            [orderId] => 269
            [shortName] => b
        )

    [2] => Array
        (
            [orderId] => 269
            [shortName] => c
        )

)

Link to comment
https://forums.phpfreaks.com/topic/151389-array-sorting/#findComment-795165
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.