Forum Moderators: coopster
page 1:
$_SESSION['1']='1';
$_SESSION['2']='2';
$_SESSION['3']='3';
page2:
$_SESSION['4']='4';
$_SESSION['5']='5';
$_SESSION['6']=6';
page3:
$_SESSION['7']='7';
$a=array( 'foo', 'bar');
$a=array( 0=>'foo', 1=> 'bar');
$a=array( 0=>'foo', 'bar');
$a=array( 'foo', 1=>'bar');
$a[0]='foo';
$a[1]='bar'];
$a=['foo','bar'];
$b=array('wall'=>'green', 'floor'=>'red', 'ceiling'=>'orange');
$c=$b['floor'];
foreach ($b as $key => $value) {
print('The '.$key.' is '.$value'."\n");
}
$b['table']='purple';
$a[]='foobar';
$emtpy=array();
$matrix=array (
0 => array (
'a' => 'row 0, col a',
'b' => 'row 0, col b'
),
1 => array (
'a' => 'row 1, col a',
'b' => 'row 1, col b'
)
)
I think you've 2 aspects to your question:
One is about arrays
The other is about sessions
Since arrays are used even in your example, let's start with that as it's more basic and needs to be understood before you can build on it further.
Do you mean all those examples literally?
blahblah['something']=$something
blahblah['something-else']=$something-else
with the same string value on each side?
session_start();
$name = "notsetyet";
$whatever = "notsetyet"
$_SESSION['id'] = $id;
$_SESSION['name'] = $name;
$_SESSION['whatever'] = $whatever;
$_SESSION['etc'] = $etc;