我有这样的会议
$id = 'A001'
$_SESSION['cart'][$id]
它包含如下的值
Array
(
[A001] => Array
(
[path] => product-details.html
[img] => images/product/3.jpg
[size] => 12 x 1.5 L
[price] => 8.8
[quantity] => 1
[total] => 8.8
)
)
如何判断这个$ _SESSION ['购物车'] [id是否已存在] ???
答案 0 :(得分:0)
答案 1 :(得分:0)
if (isset($_SESSION['cart'][$id])) {
// its set...
}