Re: passing an array from a form
| From: | Rasmus Lerdorf | Date: | Fri, 23 Jun 2000 09:43:47 +0000 |
| Subject: | Re: passing an array from a form | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-2765@lists.php.net to get a copy of this message | ||
> hi all,
> I'm trying to pass an array from a form field but without much success.
> Here is my code: <input type="hidden" name="dates_array[]"
> value="$dates_times[$i]"> and I put this through a "for" loop. When i
> see
> what is inside of "$dates_array" all I get is "A" which is not one of the
> items in the array. What am I doing wrong?
It is a good idea to jump out of a quoted string when you are going to
print anything other than a simple variable.
eg.
echo "<input type=\"hidden\" name=\"dates_array[]\"
value=\"".$dates_array[$i]."\">
-Rasmus