Well, can't say I see the same problem:

$_SESSION['foo'] = array("hi"=>"bye");

echo "\n\n";
print is_array($_SESSION['foo']);

X-Powered-By: PHP/4.2.2
Content-type: text/html

    [hi] => bye

Which is what I'd expect it to show.

Now how did you assign categories?

Maybe the var is a scalar and is actually "Array (\n  [0] => '1';\n  [1] =>
'12';" and you are confused.o

If you are saying:

$_SESSION['categories'] = "Array (
    [0] = '1';

Then it IS a scalar.  Try this:

print ":::{$_SESSION['categories']}:::";

If you get this:


Then I have no clue what the problem is

If you don't get that, then we know what your problem is.


On Tue, 29 Oct 2002, Ryan Neudorf wrote:

> I'm having a problem with session variables and arrays.
> I'm building a multi step sign up form and I need to store all the
> variable until the final step, when they are inputed to a database. I
> thought the best way to do this would be to store the contents for
> $HTTP_POST_VARS in session variables. This works fine for everything
> except for my array of checkboxes.
> When I do a print_r($_SESSION) it displays the following for the
> sessionvariable assigned to the checkboxes:
> [categories] => Array (
>       [0] => '1';
>       [1] => '12';
> ... Etc ...
> But when I run any sort of array function (is_array, foreach) on
> $_SESSION['categories'] it appears that it is a scalar, not an array.
> Any ideas?
> - Ryan
> --
> PHP Database Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php

Peter Beckman            Systems Engineer, Fairfax Cable Access Corporation
[EMAIL PROTECTED]                             http://www.purplecow.com/

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

Reply via email to