Sort an array by value type. Where do I start :)?? [message #174984] |
Fri, 29 July 2011 04:07 |
Andrew Senner
Messages: 1 Registered: July 2011
Karma: 0
|
Junior Member |
|
|
I couldn't find an function from the docs which sufficed... or at
least I couldn't put the match together.
I'm looking for a way to sort and array by value type
i.e:
array(array(), array(), "value", "value", array(), "value", "value",
array());
sort of like a directory tree.. it's a giant array of configuration
data and the values for each array are mixed in with child arrays.
The outcome I would like to see is:
array("value", "value", "value", "value", array(), array(), array());
after the sort with the values before the sub arrays, I don't need the
actual values sorted... just their types sorted.... I'm thinking I
have to write my own comparison callback and use usort??? Fill me in
and thanks for your time.
|
|
|
Re: Sort an array by value type. Where do I start :)?? [message #174988 is a reply to message #174984] |
Fri, 29 July 2011 14:19 |
Denis McMahon
Messages: 634 Registered: September 2010
Karma: 0
|
Senior Member |
|
|
On Thu, 28 Jul 2011 21:07:01 -0700, Andrew Senner wrote:
> I'm looking for a way to sort an array by value type
> I'm thinking I have
> to write my own comparison callback and use usort??? Fill me in and
> thanks for your time.
I think you probably nailed it with that last sentence.
Rgds
Denis McMahon
|
|
|