FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » Imported messages » comp.lang.php » Sort an array by value type. Where do I start :)??
Show: Today's Messages :: Polls :: Message Navigator
Switch to threaded view of this topic Create a new topic Submit Reply
Sort an array by value type. Where do I start :)?? [message #174984] Fri, 29 July 2011 04:07 Go to next message
Andrew Senner is currently offline  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 Go to previous message
Denis McMahon is currently offline  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
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: The prefered way to handle mobile apps?
Next Topic: Coders needed - The Underground
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Wed Nov 27 06:27:28 GMT 2024

Total time taken to generate the page: 0.02780 seconds