I need to remove an item from an array, I know the array's 'KeyID' and so the code to remove is used:
foreach($_SESSION["Basket"] as $key => $value)
{
if($key == $DelItemID)
{
unset($_SESSION["Basket"][$key]);
}
}
Now I've unset... my array looks something like
[0] Item 1
[2] Item 3
I need to "resort" the array and maintain the index so it remains..
[0]...
[1]...
I've tried to use:
rsort($_SESSION["Basket"]);
And, it didn't help - but maybe I am using it incorrectly.
All help from you guys n gals would be greatly apperciated! Thanks in advance.