yo. making a shopping cart, using sessions to remember the contents, and storing the products in an array $cart[]. im making a thing so people can remov items from teh cart. problem is this.
it ends up as having an array like this....
$cart[0]="lamp";
$cart[1]="toothbrush";
$cart[2]="mug";
$cart[3]="pair or scissors";
etc...
so when they remove an item, it unsets that item. say they dont want the mug anymore, it removes it, but then im left with this:
$cart[0]="lamp";
$cart[1]="toothbrush";
$cart[3]="pair or scissors";
when really i want this...
$cart[0]="lamp";
$cart[1]="toothbrush";
$cart[2]="pair or scissors";
So how can i force the index numbers to be sequential again? i cant find an array function that does this....
any helps would be cool. cheers