RE: [PHP] Array in Session-Vars?
| From: | Rudolf Visagie | Date: | Fri, 30 Mar 2001 08:52:25 +0000 |
| Subject: | RE: [PHP] Array in Session-Vars? | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-46264@lists.php.net to get a copy of this message | ||
I can't really see a problem with registering arrays as session variables
(in PHP4). I use the following in a script and it works fine:
while (OCIFetch($rs)) {
$n = $n + 1;
$ix[$n] = OCIResult($rs,1);
}
session_register("n");
session_register("ix");
Rudolf Visagie
rudolf@qedi.co.za
-----Original Message-----
From: Renze Munnik [mailto:renze@datalink.nl]
Sent: 30 March 2001 10:38
To: php-general@lists.php.net
Subject: Re: [PHP] Array in Session-Vars?
elias wrote:
>
> I never tried to use arrays in session variables,
> but i believe if you try to serialize the array first and then register
the
> serialized value as session value it should work.
> and ofcourse to retrieve it do reverse work by unserializing the variable
> back to the array and use it.
>
> -
> $a = Array("asdad", "adasd", "123123", "6adas f g");
> echo ($s = serialize($a)) . "<br>";
> // you can session_register($s)
> unset($a);
> // in file2 you can retrieve $s and make $a back again:
> $a = unserialize($s);
> var_dump($a);
>
> -
> -elias
Hi,
Never tried it either, but from previous postings I remember you
should just be able to use array's with no prob's.
(4 all I can remember i.e.)
* R&zE:
***************************
** Renze Munnik
**
** E: renze@datalink.nl
** M: +31 6 218 111 43
***************************
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net
For additional commands, e-mail: php-general-help@lists.php.net
To contact the list administrators, e-mail: php-list-admin@lists.php.net