Page 1 of 1

PHP SESSEION HELP

Posted: Tue Dec 02, 2008 6:01 am
by cjconnor24
Hi all,

Could someone please clarify something to do with php sessions please.

i often see:

Code: Select all

$aNewVar = $_SESSION['theSessionName'][color=#FF0000][b]['somethingelse'][/b][/color];
what do the the second set of square brackets do?

thanks in advance
c

Re: PHP SESSEION HELP

Posted: Tue Dec 02, 2008 10:35 am
by novice4eva
Think of it as a 2d array. well somewhere session could have been set like this(1 of 1000 ways )

Code: Select all

 
$mysessionValues = array('somethingelse'=>'my bike','replaceBy'=>'new yamaha bike');
$_SESSION['theSessionName'] = $mysessionValues;
$aNewVar = $_SESSION['theSessionName']['somethingelse'];//$aNewVar = my bike