note 45060 added to function.session-register

From: Date: Tue, 24 Aug 2004 19:41:07 +0000
Subject: note 45060 added to function.session-register
Groups: php.notes 
Request: Send a blank email to php-notes+get-75217@lists.php.net to get a copy of this message
If you use a lot of $_SESSION variables, you can put them into an array. For example like that: while($f=mysql_fetch_row($result)) {$i++; $_SESSION['foo1[$i]'] =$f[0]; $_SESSION['foo2[$i]']= $f[1]; } However, when I call the $_SESSION-variable, it is necessary to use the same counter variable name. This will not work: $p=3; echo '<input type =text value ='.$_SESSION['titel[$p]'].'>'; That one is ok: $i=3; echo '<input type =text value ='.$_SESSION['titel[$i]'].'>'; Hope it will help. ---- Manual Page -- http://www.php.net/manual/en/function.session-register.php Edit -- http://master.php.net/manage/user-notes.php?action=edit+45060 Delete -- http://master.php.net/manage/user-notes.php?action=delete+45060&report=yes Reject -- http://master.php.net/manage/user-notes.php?action=reject+45060&report=yes Search -- http://master.php.net/manage/user-notes.php

« previous php.notes (#75217) next »