Ross wrote:
> I am creating an array of sessions
> 
> $_SESSION['results'][]

always call session_start() before using $_SESSION

> 
> 
> There may be up to 7 and I need to know why do  I always get the 
> notice'Undefined index: results in...'?
> 
> How do I define or initialise the array if it only gets set once the form 
> has been posted (an answer has been given) on the page.
> 
> Is there a way to count/output (FOR EACH?) a set of session arrays like 

if (is_array($_SESSION['results'])) echo 'number of results is ', 
count($_SESSION['results']);

foreach ($_SESSION['results'] as $number => $data) {
        echo "result number $number contains:";
        var_dump($data);
}

> this?
> 
> 
> Ta,
> 
> Ross
> 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to