Here is what I am attempting to do. How would you go about using sessions to create an array? I need it to be ripped apart using foreach().
$_SESSION['global_nums'] = "\$global_nums = array ($global_nums,$random_num);";
Now when I call my foreach:
foreach ($global_nums as $v) {
echo "Current value of \$a: $v.\n";
}
I KNOW there has to be an easier way of doing this. But for the sake of being late and searching I just put it up here.
I did also try this one ::
<?php
session_start();
if(!isset($global_nums)){
$_SESSION['global_nums'] = "0";
}
echo "$global_nums";
$random_num = RAND(1,12);
$_SESSION['global_nums'] = "$global_nums,$random_num";
foreach (array($global_nums) as $v) {
echo "$v\n";
}
?>
It is horribly sloppy but hey I am just trying to get it to work. Any help that would be great! Thanks so much!
Chad