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

WBOY
Release: 2016-06-02 11:28:30
Original
924 people have browsed it

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>
Copy after login
Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!