when my page opens it 'loads' two arrays from an included file which has this in it :
$title = array("this is title 1", "this is title 2", "this is title 3", "this is title 4");
$text = array("this is text 1", "this is text 2", "this is text 3", "this is text 4");
ok - this happens the first time, but after that i need to add/remove elements from the arrays and only save it back to a file right at the end.
So, I figured i'd use a SESSION variable to contain each array and that way i could keep it each time the page is reloaded.
I read the manual section and the 'Stcky' on global session variables but i must admit i didn't really see how to turn my arrays into session variables.
do i just do this? :
$_SESSION[test] = $test;
and how do i access the array elements - is it like this ?:
Code: Select all
<?php
for($i=0; $i<$numEvents; $i++){
echo $_SESSION[test[$i]]."<br>";
}
?>could anyone lend a helping hand ?
thanks