Re: session array

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux