Re: Variables in a loop
| From: | Bruno Gimenes Pereti | Date: | Tue, 30 Oct 2001 10:11:24 +0000 |
| Subject: | Re: Variables in a loop | ||
| References: | 1 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-13841@lists.php.net to get a copy of this message | ||
try
<form...>
<input name=a[] value=..>
<input name=a[] value=..>
<input name=a[] value=..>
<input name=a[] value=..>
and
for ($i=1; $i<=10; $i++) { $tab[$i]=$a[$i] ;}
This way $a will be a array.
Hope it helps
Bruno Gimenes Pereti.
----- Original Message -----
From: "LeTortorec, Jean-Louis" <JLeTortorec@healthcore.com>
To: <php-db@lists.php.net>
Sent: Monday, October 29, 2001 7:03 PM
Subject: [PHP-DB] Variables in a loop
> I'm trying to write a loop to read variables I receive from a form:
>
> <form ...>
> <input name=a1 value=..>
> <input name=a2 value=..>
> <input name=a3 value=..>
> <input name=a4 value=..>
>
>
> I'd like to get something like:
>
> for ($i=1; $i<=10; $i++) { $tab[$i]="a".$i ;}
>
>
> The expression "a".$i is actually a string, not a variable. Any idea how
to
> "read" the value of that string?
>
> Thanks for your help.
>
> Jean-Louis
>
>
>
>
>