Re: Re: array - change elements position
| From: | Evandro Sestrem | Date: | Thu, 25 Apr 2002 21:11:27 +0000 |
| Subject: | Re: Re: array - change elements position | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-94664@lists.php.net to get a copy of this message | ||
This is what I was looking for!
Thank you very much.
"Miguel Cruz" <mnc@stoic.net> escreveu na mensagem
news:Pine.LNX.4.44.0204251604131.29480-100000@stoic.net...
> On Thu, 25 Apr 2002, Evandro Sestrem wrote:
> > My example wasn't good.
> >
> > I have a array of objects and want change its positions.
> >
> > $array = (obj2, obj1, obj3) --> $array = (obj1, obj2, obj3).
> >
> > Like TStringList.Exchange in Delphi.
> >
> > Sort() don't work in this case, because I want sort based in a attribute
of
> > the object.
>
> Why not try usort(). You can supply any sorting scheme you want.
>
> miguel
>