Re: Sessions and Arrays
| From: | Negrea Mihai | Date: | Tue, 08 Apr 2003 16:23:59 +0000 |
| Subject: | Re: Sessions and Arrays | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-142903@lists.php.net to get a copy of this message | ||
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
echo $_SESSION['AppUI']['user_id'];
On Tuesday 08 April 2003 07:20 pm, Erich Kolb wrote:
> If I do:
>
> while (list($key,$val) = each($_SESSION['AppUI'])) {
> echo $key." ".$val."<br />";
> }
>
> I get:
>
> state Array
> user_id 5
> user_first_name Erich
> user_last_name Kolb
> user_company 1
> user_department 1
> user_type 1
> user_prefs Array
> project_id 0
> day_selected Object
> user_locale en
> base_locale en
> locale_warn
> locale_alert ^
> styles Array
> msg
> msgNo 0
> defaultRedirect
> cfg Array
>
> How do I get the value from the above "user_id" into a variable so that I
> can echo it, or use it to perform a db query, etc.?
- --
Negrea Mihai
http://www.negrea.net
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.7 (GNU/Linux)
iD8DBQE+kvef8hhhNOp8KlQRAgLqAKCr4vgM7HzYzcGx3AqoKBpJOgP7tACgjUDB
KZVizZWN5ZDSOEhXF+ojvqo=
=wJCR
-----END PGP SIGNATURE-----