[PHP] Re: resetting arrays

2005-06-21 Thread Al
in general, you should use "0" as your first key, not 1. It'll save trouble. array_values() will index from 0 $pos= 0; unset($ses_basket_items[$pos]) //will remove the first item. I. Gray wrote: Thanks Al, That's done it! unset($ses_basket_items[$pos]); $ses_basket_items = array_va

Re: [PHP] Re: resetting arrays

2005-06-21 Thread I. Gray
]); $ses_basket_items = array_values($ses_basket_items) ; -Original Message- From: I. Gray [mailto:[EMAIL PROTECTED] Sent: 21 June 2005 14:21 To: php-general@lists.php.net Subject: [PHP] Re: resetting arrays * This e-mail has been received by the Revenue Internet

RE: [PHP] Re: resetting arrays

2005-06-21 Thread Shaw, Chris - Accenture
@lists.php.net Subject: [PHP] Re: resetting arrays * This e-mail has been received by the Revenue Internet e-mail service. * Thanks Al, That's done it! unset($ses_basket_items[$pos]); $ses_basket_items = array_v

[PHP] Re: resetting arrays

2005-06-21 Thread I. Gray
Thanks Al, That's done it! unset($ses_basket_items[$pos]); $ses_basket_items = array_values($ses_basket_items) ; They aren't big arrays so I suppose I shouldn't worry about exceeding memory limits - http://uk2.php.net/manual/en/function.array-values.php#36837 ? My only problem now is th

[PHP] Re: resetting arrays

2005-06-21 Thread Al
I. Gray wrote: Hi. I am sure this is easy, but I can't get this work. Is there not a php function that can do this? I have an array- for example... [1] => Yellow [2] => Green [3] => Purple [4] => Blue [5] => Red [6] => Orange [7] => Cyan What happens, say if I delete [3] => Purple? I get..