Reply to Re: print order of assoctive array

Your name:

Reply:


Posted by Erwin Moller on 10/27/12 11:33

Ewoud Dronkert wrote:

> Erwin Moller wrote:
>> Move every element in your array to a new array
>
> Why? Just apply uksort to $val (the 2nd level array).

Hi Ewoud,

Yes, you are right.

The situation I was describing was an array with a complex structure per
element that it contained (more arrays actually, but complex sounds so
great).

The underlying arraystructure differed from element to element.

For some stupid reason I thought the function called by uksort could only
operate on single simple values, which turned out to be nonsense.
(I guess I guessed wrong, based on my experiences with Java, where that
logic is just implemented a little differently for sorting.)

I reread the uksort-function, and the function used just receives the
elements, which can be used to look deeper into their arrays.

Anyway, I got it now.
I will be using uksort a lot more now, so thanks.

You just made my life a little easier (and my code a little faster).
:-)

Regards,
Erwin Moller

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация