RE: [PHP-WIN] array way....
| From: | Rich Gray | Date: | Mon, 26 Aug 2002 02:08:16 +0000 |
| Subject: | RE: [PHP-WIN] array way.... | ||
| References: | 1 | Groups: | php.windows |
| Request: | Send a blank email to php-windows+get-15497@lists.php.net to get a copy of this message | ||
Crizz
use myvar[] in the form and PHP will generate an array for you
<input type="text" name="myvar[]">
<input type="text" name="myvar[]">
HTH
Rich
-----Original Message-----
From: crizz [mailto:crizz18@yahoo.com]
Sent: 25 August 2002 09:21
To: php-windows@lists.php.net
Subject: [PHP-WIN] array way....
Can you helpme with that?
I have some variables with names like: $myvar1, $myvar2, $myvar3... and so
on... and I want to put them in an array. Ofcourse I need a Loop because I
don't know the number of the variables.
It will probably be like that:
$myarray= range(1,NumberOfVars);
$i=1
while ($ i <= NumberOfvars) {
$myarray[$i]= $myvar.$i; # <----here is the problem right?
}
To be honest, the $myvar1... variables come with "post" method from a form
and because I don't know how to send the directly as arrays I need this. So
if someone knows how to send them directly from the form as arrays (if
possible) it would be great
thanks for advance,
just started with php, crizz :D
--
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php