RE: [PHP] in the middle of shift and pop

2003-08-21 Thread Ford, Mike [LSS]
> -Original Message- > From: Decapode Azur [mailto:[EMAIL PROTECTED] > Sent: 20 August 2003 23:54 > > > If you unset an array that isn't associative, will that ALL PHP arrays are associative. It's just that some arrays have only numeric keys. > mean there will > > be a gap in the numbe

Re: [PHP] in the middle of shift and pop

2003-08-20 Thread Robert Cummings
On Wed, 2003-08-20 at 23:38, Jaap van Ganswijk wrote: > > Finding a single element in a doubly linked list can > be sped up using a hash-code table, but it also > makes things like renumbering numerically indexed > entries a lot harder (I think, I never used a > combination of these things.) Doub

Re: [PHP] in the middle of shift and pop

2003-08-20 Thread Jaap van Ganswijk
At 2003-08-21 00:54 +0200, Decapode Azur wrote: >> Or will PHP realize "OK I need to change the numbers indexing the other >> elements"? > >** as PHP is a high level language I can write very quickly and very easily >scripts to make manipulations on my 3D meshes, but the problem is that it >often

Re: [PHP] in the middle of shift and pop

2003-08-20 Thread Decapode Azur
> If you unset an array that isn't associative, will that mean there will > be a gap in the numbers? Yes the items are grabed by their index. I'm using those arrays to manipulate 3D geometric shapes, (either vrml/x3d, OpenGL, POV and other ones**) so cartesian coordinates are first referenced in a

RE: [PHP] in the middle of shift and pop

2003-08-20 Thread Ford, Mike [LSS]
> -Original Message- > From: Decapode Azur [mailto:[EMAIL PROTECTED] > Sent: 20 August 2003 00:10 > > > unset($A[2]); > > No this function does not exactly what I want. > unset() makes empty hole with $A[2] = Null > > I would like to have this result : > Array > ( > [0] => a > [1

Re: [PHP] in the middle of shift and pop

2003-08-19 Thread Dan Anderson
If you unset an array that isn't associative, will that mean there will be a gap in the numbers? Or will PHP realize "OK I need to change the numbers indexing the other elements"? -Dan On Tue, 2003-08-19 at 22:27, andu wrote: > On Wed, 20 Aug 2003 00:25:32 +0200 > Decapode Azur <[EMAIL PROTECTED

Re: [PHP] in the middle of shift and pop

2003-08-19 Thread Dan Anderson
Well, if you knew (for instance) that $A[2] should be removed then you could do something like: $value) { if ($key < 2) { $B[$key] = $value; } elseif ($key > 2) { $B[($key - 1)] = $value; } } ?> Modify the above code as needed... -Dan On Tue, 2003-08-19 at 22:25, Decapode Azur wrote:

Re: [PHP] in the middle of shift and pop

2003-08-19 Thread David Otton
On Wed, 20 Aug 2003 00:25:32 +0200, you wrote: >is it possible to remove an element of an indexed array such as this exemple > $A = array('a', 'b', 'c', 'd', 'e', 'f'); >in a way that we can optain this result : > $A = array('a', 'b', 'd', 'e', 'f'); > >something like that perhaps ? >a

Re: [PHP] in the middle of shift and pop

2003-08-19 Thread Decapode Azur
> unset($A[2]); No this function does not exactly what I want. unset() makes empty hole with $A[2] = Null I would like to have this result : Array ( [0] => a [1] => b [2] => d [3] => e [4] => f ) and not this one : Array ( [0] => a [1] => b [3] => d [4] => e

Re: [PHP] in the middle of shift and pop

2003-08-19 Thread Decapode Azur
> is it possible to remove an element of an indexed array such as this > exemple $A = array('a', 'b', 'c', 'd', 'e', 'f'); > in a way that we can optain this result : > $A = array('a', 'b', 'd', 'e', 'f'); > > something like that perhaps ? > array_remove($A, 2); > > If such a function does no

RE: [PHP] in the middle of shift and pop

2003-08-19 Thread Ralph Guzman
unset($A[2]); -Original Message- From: Decapode Azur [mailto:[EMAIL PROTECTED] Sent: Tuesday, August 19, 2003 3:26 PM To: [EMAIL PROTECTED] Subject: [PHP] in the middle of shift and pop is it possible to remove an element of an indexed array such as this exemple $A = array(&#

Re: [PHP] in the middle of shift and pop

2003-08-19 Thread andu
On Wed, 20 Aug 2003 00:25:32 +0200 Decapode Azur <[EMAIL PROTECTED]> wrote: > is it possible to remove an element of an indexed array such as this > exemple > $A = array('a', 'b', 'c', 'd', 'e', 'f'); > in a way that we can optain this result : > $A = array('a', 'b', 'd', 'e', 'f'); >

[PHP] in the middle of shift and pop

2003-08-19 Thread Decapode Azur
is it possible to remove an element of an indexed array such as this exemple $A = array('a', 'b', 'c', 'd', 'e', 'f'); in a way that we can optain this result : $A = array('a', 'b', 'd', 'e', 'f'); something like that perhaps ? array_remove($A, 2); If such a function does not exis