Re: Another hand wringer
| From: | Richard Lynch | Date: | Tue, 20 Feb 2007 23:26:54 +0000 |
| Subject: | Re: Another hand wringer | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-249138@lists.php.net to get a copy of this message | ||
On Sun, February 18, 2007 3:06 pm, jekillen wrote:
> iterator $i and given a_$i+1 names. If I test for the field names
> on post literally, a_1, a_2, a_...n, the values are getting posted
> properly.
Save yourself a LOT of headaches and index-munging and just do this:
<input name"a[1]" value="whatever" />
<input name"a[2]" value="whatever" />
<input name"a[3]" value="whatever" />
Then:
$a = $_POST['a'];
//$a is now an array with indices 1, 2, and 3.
The time you spend re-writing it this way will be paid off almost
immediately.
--
Some people have a "gift" link here.
Know what I want?
I want you to buy a CD from some starving artist.
http://cdbaby.com/browse/from/lynch
Yeah, I get a buck. So?