Since its the last element, just pop it out:
array_pop()
--- kaab kaoutar <[EMAIL PROTECTED]> wrote:
> Hi!
> how can i decrement the length of an array!
> In fact i'm trying to delete an element from an
> array , i'v put the content
> of i in i-1 (loop) and i tried to decrement the
> array legnt
=[c333]
Unset b2 now
key=[a], value=[Array]
key2=[1], value2=[a111]
key2=[2], value2=[a222]
key2=[3], value2=[a333]
key=[b], value=[Array]
key2=[1], value2=[b111]
key2=[3], value2=[b333]
key=[c], value=[Array]
key2=[1], value2=[c111]
key2=[2], value2=[c222]
key2=[3], value2=[c333]
>
>
&
[EMAIL PROTECTED]>
>CC: [EMAIL PROTECTED]
>Subject: Re: [PHP] delete an element from an array
>Date: Mon, 5 Mar 2001 10:57:49 -0500
>
>Have a look at
>
> http://www.php.net/manual/en/function.unset.php
>
>"unset" may do what you
Have a look at
http://www.php.net/manual/en/function.unset.php
"unset" may do what you want.
HTH.
--
Hardy Merrill
Mission Critical Linux, Inc.
http://www.missioncriticallinux.com
kaab kaoutar [[EMAIL PROTECTED]] wrote:
>
> Hi!
> FIRST OF ALL THANKS !
> well do u mean that the only way
Hi!
FIRST OF ALL THANKS !
well do u mean that the only way to remove an elemnt from an array is to
copy it into another array? it does not suit me cause the array is a session
variable and i need to update it !
Thanks
_
Get
I'm not sure what you mean - are you trying to remove an element
from the array while you are *inside* a loop that is iterating
through that same array? If the loop is small enough, copy it
in so we can all see what you are trying to do.
kaab kaoutar [[EMAIL PROTECTED]] wrote:
> Hi!
> how can i
Hi!
how can i decrement the length of an array!
In fact i'm trying to delete an element from an array , i'v put the content
of i in i-1 (loop) and i tried to decrement the array legnththis way:
count($x)=count($x)-1;
but it generates an error!
Thanks
___
7 matches
Mail list logo