Re: [PHP] Sorting array of objects

2004-04-05 Thread Marek Kilimajer
Richard Harb wrote: Hi there, Supposed I have an array of objects, like: $this[$i]->property1 $this[$i]->property2 is there any 'cheap' way to sort the array according to the values of property1? http://www.php.net/usort Example: function cmp($a, $b) { if ($a->property1 == $b->property1) {

Re: [PHP] Sorting array of objects

2004-04-05 Thread Rob Ellis
On Mon, Apr 05, 2004 at 05:03:17AM +0200, Richard Harb wrote: > Hi there, > > Supposed I have an array of objects, like: > > $this[$i]->property1 > $this[$i]->property2 > > is there any 'cheap' way to sort the array according to the values of > property1? > Try array_multisort() -> // cre

Re: [PHP] Sorting array of objects

2004-04-04 Thread Tom Rogers
Hi, Monday, April 5, 2004, 1:03:17 PM, you wrote: RH> Hi there, RH> Supposed I have an array of objects, like: $this[$i]->>property1 $this[$i]->>property2 RH> is there any 'cheap' way to sort the array according to the values of RH> property1? RH> The only way I thought I would be able to acco