And Sign before foreach loop

hi

i got this code while googling on net


 foreach ($_SESSION["cart_array"] as [COLOR="#FF0000"]&$each_item[/COLOR]) {
            if ($each_item['item_id'] == $pid) {
                $each_item['quantity'] += 1;
                $wasFound = true;
                break;
            }

can someone tell me what does “&” sign before $each_item signifies

what is the use of “&” sign before $each_item in foreach loop

vineet

It’s a reference: http://php.net/manual/en/language.references.php

To see what it does, do a var_dump of $_SESSION[“cart_array”] before and after the loop, and check for differences.

And then do a similar loop with the &, do a var_dump of $_SESSION[“cart_array”] before and after that loop, and check for differences.