note 45060 deleted from function.session-register by philip

From: Date: Wed, 29 Mar 2006 06:21:40 +0000
Subject: note 45060 deleted from function.session-register by philip
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-106911@lists.php.net to get a copy of this message
Note Submitter: Tümmel atop at bluewin dot ch ---- 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.

« previous php.notes (#106911) next »