php - Session array with productids -
i'm adding product ids session array with:
if (isset($_get["add"]) && (int)$_get["add"]>0) { $_session['products'][] = $_get["add"]; }
how loop array , add class products ids in array?
what this:
... $_session['products'][$_get["add"]] = true ; ...
then ask
if ($_session['products']) { ... }
or in loop
foreach ($_session['products'] $id=>$isset) { // ... }
btw shorter cond:
if (($_get["add"]*1)>0)
Comments
Post a Comment