Home >Backend Development >PHP Tutorial >php基础问题,会话变量 数组,请指点

php基础问题,会话变量 数组,请指点

WBOY
WBOYOriginal
2016-06-23 13:56:02863browse

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])) //这一句是什么意思??$new是一个传入的参数,该参数是一本书的isbm码,9787111262817,请问$_SESSION['cart'][$new] 是什么意思??这样会得出什么结果?能否详细描述下。感谢ing....      $_SESSION['cart'][$new]++;    else       $_SESSION['cart'][$new] = 1;


回复讨论(解决方案)

??你能看懂??
$new='a';
$_SESSION['cart']=array(
'a'=>'xxx',
);

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn