Can you post/send the results of doing a print_r() on the first page (the
one that's serialising) and the results of the serialize()?

-----Original Message-----
From: DoL [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, July 31, 2002 2:21 PM
Subject: [PHP] passing arrays between pages with serialize


I would like to pass three arrays, two of them are two dimensional arrays,
to another page (or to the same page just submit to itself) using hidden
field and the function serialize.

(this is a two dimensional array)
 $s_array1 = serialize($array1);

<INPUT type="HIDDEN" name="h_array1" value="<?php echo urlencode($s_array1);

 $array1= unserialize(urldecode(stripslashes($_POST['h_array1'])));

it seems to work except there appears to be one NULL record added to the
beginning of the array.
it affects the following :-
count(array_keys($array1) ) returns actual_no_of_keys + 1
foreach () echo with one NULL record at the beginning
reset($array1) erase the array completely !!

and it doesn't help to use rawurl(en|de)code, and with | without

PLEASE HELP! if you can resolve this, or has a better ways to pass arrays
between pages.

Many Thanks

PHP General Mailing List (
To unsubscribe, visit:

PHP General Mailing List (
To unsubscribe, visit:

Reply via email to