Home  >  Article  >  Backend Development  >  php-关于PHP的session调用的问题

php-关于PHP的session调用的问题

WBOY
WBOYOriginal
2016-06-02 11:28:30925browse

sessionphp

请教各位大神,下面PHP代码中"$_SESSION['cart'][$new]"的使用是什么语法?

<code>  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;    }</code>
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