Re: Array + session
| From: | Soeren Staun-Pedersen | Date: | Mon, 02 Oct 2000 08:13:06 +0000 |
| Subject: | Re: Array + session | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-18253@lists.php.net to get a copy of this message | ||
> More information is needed. Do you auto start your session? do you call
> session_start()? Is it in a function? did you remember global $myarray; ?
> --
> well...
> session is already started..
> i can quite register a simple variable... but i receive problems with array.
> The array is inside a function and i pass it as argument.
>
> The array-variable is set.. but isn't an array.
Example:
function doRegisterStuff()
{
global $FOOBAR;
$FOOBAR="Foobar's are excellent for testing stuff";
session_register("FOOBAR");
}
The global is needed to tell PHP that the variable matters in a larger
scope. I don't know phplib, as I used php4 since day 1, but in php4 there
is no difference at all between arrays and other types in sessions.
I think you're looking in the wrong place for your bug.
Cheers,
Soeren Staun-Pedersen - Staun@SunSITE.auc.dk
------
"The internet is full, beat it"
- Me.