session array variable fatfree -
i playing own way of storing user selected items on simple shop system uses hidden int values( primary id item) form.
on each selection test see if session variable has been set if not:
if ($f3->get('session.item') == null) { $f3->set('session.item',array($itemfrompost )); ... }
if has been set push next selection :
$f3->push('session.item',$itemfrompost);
it promising , can count of items like:
$total = (count ( $f3->get('session.item')
also can this:
echo $f3->get('session.item[0]');
what doesn't work when want run through items:
for ($i= 0; $i <= totalcountvalueminus1; $i++ ) { echo $f3->get('session.item[$i]'); }
how do this?
Comments
Post a Comment