Re: Sessions and Arrays
| From: | Negrea Mihai | Date: | Tue, 08 Apr 2003 16:09:21 +0000 |
| Subject: | Re: Sessions and Arrays | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-142897@lists.php.net to get a copy of this message | ||
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