【发布时间】:2017-04-19 10:53:24
【问题描述】:
case "remove":
if(!empty($_SESSION["cart"])) {
foreach($_SESSION["cart"] as $k => $v) {
if($_GET["code"] == $k){
//print_r($_SESSION["cart"][$k]);
unset($_SESSION["cart"][$k]);
header("Location:../cart.php");
} else {
}
}
}
break;
当我的购物车中只有一件商品时,该功能可以正常工作,但是当我有很多商品时,该商品无法删除,我该如何解决这个问题?
【问题讨论】: