Re: Array as hidden input
| From: | Meir kriheli | Date: | Sat, 30 Sep 2000 10:53:54 +0000 |
| Subject: | Re: Array as hidden input | ||
| References: | 1 2 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-3181@lists.php.net to get a copy of this message | ||
On Thu, 28 Sep 2000, Hellekin O. Wolf wrote:
> Mirko Nalesso wrote:
> > Hi,
> > I've a problem. Can an input hidden in a form be an array? Example:
> >
> > File prova.php
> >
> > <?
> > $arr=array();
> > $arr[1]=11;
> > $arr[2]=12;
> > $arr[3]=13;
> > ?>
> > <form method="post" method="prova1.php">
> > <? echo "<input type=\"hidden\" name=\"arr\"
> > value=\"$arr\">"; ?>
> > <input type=submit value="NEXT" >
> > <form>
> >
> > File prova1.php:
> >
> > <?
> > echo"$arr[1] - $arr[2] - $arr[3]";
> > ?>
> >
> > On the Netscape, file prova1.php appears:
> >
> > r - r - a
> >
> > What's wrong?
> >
> > Mirko.
>
> *** Hello,
>
Take a look at the serialize, and unserialize functions. They should do the
job.
http://www.php.net/manual/function.serialize.php
http://www.php.net/manual/function.unserialize.php
The fomrer takes an array and converts it into a string.
The later takes the string and converts it into and array.
--
Meir Kriheli
MKsoft computer systems
"There's someone in my head but it's not me" - Pink Floyd