Re: [PHP] Re: array - change elements position

2002-04-25 Thread Evandro Sestrem
This is what I was looking for! Thank you very much. "Miguel Cruz" <[EMAIL PROTECTED]> escreveu na mensagem [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > On Thu, 25 Apr 2002, Evandro Sestrem wrote: > > My example wasn't good. > > > > I have a array of objects and want change its positions. > >

Re: [PHP] Re: array - change elements position

2002-04-25 Thread Miguel Cruz
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

Re: [PHP] Re: array - change elements position

2002-04-25 Thread Pushkar Pradhan
Have you thought about swapping the elements, it's quite simple, I don't know about more complicated methods using pointers here's the code: $layer is the array - $currPos = array_search($HTTP_POST_VARS["selLayer"], $layer); $temp = $layer[$currPos]; $layer[$currPos] = $layer[$cu

[PHP] Re: array - change elements position

2002-04-25 Thread Evandro Sestrem
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. Evandro "Evandro Sestre