i have an array $items . it has certain elements like Array([0]=>1 1=>2 [2]=>3) . from this array i can able to remove the first and second index . but i can't remove the 0 th index using array unset method.
is there is any way to remove 0th index from array?
Thanks in advance...
<?php
session_start();
$items = $_SESSION['cart'];
$cartitems = explode(",", $items);
print_r($cartitems);
if(isset($_GET['remove']) & !empty($_GET['remove'])){
$delitem = $_GET['remove'];
unset($cartitems[$delitem]);
$itemids = implode(",", $cartitems);
$_SESSION['cart'] = $itemids;
if($_GET['remove']==0)
{
unset($cartitems[0]);
$itemids = implode(",", $cartitems);
$_SESSION['cart'] = $itemids;
}
//echo "<script>alert('removed Successfully ');window.location= '".('hide.php')."'</script>";
}
?>
i have above code. in that i am getting key(index) from $_GET['remove'].so i will unset that particular key from the array. but i can't unset that oth index.

i can't able to remove the television from the array.