时间:2021-07-01 10:21:17 帮助过:6人阅读
请教各位大神,下面PHP代码中"$_SESSION['cart'][$new]"的使用是什么语法?
if($new) { //new item selected if(!isset($_SESSION['cart'])) { $_SESSION['cart'] = array(); $_SESSION['items'] = 0; $_SESSION['total_price'] ='0.00'; } if(isset($_SESSION['cart'][$new])) { $_SESSION['cart'][$new]++; } else { $_SESSION['cart'][$new] = 1; }