Re: Sessions and Arrays

From: Date: Tue, 08 Apr 2003 16:18:48 +0000
Subject: Re: Sessions and Arrays
References: 1 2  Groups: php.general 
Request: Send a blank email to php-general+get-142900@lists.php.net to get a copy of this message
If I do $var = $_SESSION['var'][1]; There is nothing there, but I know for a fact that $var has something in it. "Negrea Mihai" <mike@spidernet.co.ro> wrote in message news:200304081909.21337.mike@spidernet.co.ro... > On Tuesday 08 April 2003 07:02 pm, Erich Kolb wrote: > > Lets say I have: > > $_SESSION['var'] = array(1,2,3,4,5); > > > > My understanding is that this would turn $_SESSION['var'] into an array. > > So how do I get the value from array(2) into a variable? > > $var = $_SESSION['var'][1]; > > the ideea is that each item in an array gets an index starting from 0 so the > array would look like: > array(0=>1, 1=>2, 2 => 3, 3 => 4, 4 => 5) > > > > -- > Negrea Mihai > http://www.negrea.net

« previous php.general (#142900) next »