You can use implode _or_ serialize for this.
$arr = array('a','b','c','d');
$vars1 = implode('|', $arr); // a|b|c|d
$vars2 = serialize($arr);// try it :)
And send one of the above strings through your
"hidden" form element.
Then upon use, either explode or unserialize it.
Also consi
On Thursday 25 April 2002 02:09, Kevin Stone wrote:
> Concept is solid, method is wrong. Understand that is but
> one index in the array. To produce an array with multiple indicies you
> must create a separate for each value. Example..
>
>
> foreach ($layer as $lay)
> {
> echo
life
to doubt as far as possible all things. - Rene Descartes
> From: Pushkar Pradhan <[EMAIL PROTECTED]>
> Date: Wed, 24 Apr 2002 13:02:17 -0500 (CDT)
> To: [EMAIL PROTECTED]
> Subject: [PHP] passing array as hidden field
>
> I want to pass a 1 dim. array through a form
d when the submit button is pressed $_POST will contain the list array
$layer.
-Kevin
- Original Message -
From: "Pushkar Pradhan" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, April 24, 2002 12:02 PM
Subject: [PHP] passing array as hidden field
> I wa
On Thursday 25 April 2002 02:02, Pushkar Pradhan wrote:
> I want to pass a 1 dim. array through a form, I use the hidden field and
> do as follows:
>
> foreach($layer as $lay) {
>print "$lay ";
> }
> print "\">
> This generates the foll. source:
>
>
> where actually it should be $layer[]
I want to pass a 1 dim. array through a form, I use the hidden field and
do as follows:
This generates the foll. source:
where actually it should be $layer[] = "a", "b", "c",
i.e. it doesn't remain an array anymore and thus I cannot do array
operations (eg. array_slice etc.) on it.
Can a
6 matches
Mail list logo