RE: [PHP] Array in a $_session

From: Date: Tue, 17 Jun 2003 09:08:39 +0000
Subject: RE: [PHP] Array in a $_session
Groups: php.general 
Request: Send a blank email to php-general+get-151801@lists.php.net to get a copy of this message
> -----Original Message----- > From: fkeessen@planet.nl [mailto:fkeessen@planet.nl] > Sent: 17 June 2003 07:48 > > Maybe you can make it a little bit clear for me? > > >You have not defined $i, so what did you expect to see here? > > >> session_start(); > >> $aantalpers=$_SESSION["aantalpers"]; > >> $test1 = $_SESSION['test1'][$i]; > > > > So is it going to be: $test1[$i ]= $_SESSION['test1'][$i]; ??? No. This is worse than before. You still have not defined what $i is -- it has no value, it is unset, it is equivalent to NULL. Therefore, $_SESSION['test1'][$i] is unlikely to return anything meaningful. At least before you were putting unknown result into a known location ($test1) -- but now you're trying to assign it to another non-meaningful place ($test1[$i], which is an unknown quantity because $i is still undefined!). Cheers! Mike --------------------------------------------------------------------- Mike Ford, Electronic Information Services Adviser, Learning Support Services, Learning & Information Services, JG125, James Graham Building, Leeds Metropolitan University, Beckett Park, LEEDS, LS6 3QS, United Kingdom Email: m.ford@lmu.ac.uk Tel: +44 113 283 2600 extn 4730 Fax: +44 113 283 3211

« previous php.general (#151801) next »