How to save indexed arrays to a session with a for loop?
<p>This is basic stuff but I seem to be way too beginner to make it work. Down here I would like to somehow get my 100 arrays into different sessions, but anything like that does not seem to work and I wonder why?</p>

<pre><code>for($i=1; $i&lt;=100; $i++) {
    $age = rand(1,100);
    $table[] = $age;
    $_SESSION[$i] = $table[];
    }
</code></pre>

<p>Later I need to be able to echo $age of all 100 sessions printed also using for loop. If I do like down there again it just says about undefined override and gives number of all 100 $i's.</p>

<pre><code>for($i=1; $i&lt;=100; $i++) {
    echo $_SESSION[$i];
    }
</code></pre>
