Re: 2D Dynamic Array from HTML Form - Possible?
| From: | Andy Flisher | Date: | Tue, 14 Nov 2000 11:32:55 +0000 |
| Subject: | Re: 2D Dynamic Array from HTML Form - Possible? | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-25176@lists.php.net to get a copy of this message | ||
In article <MPG.147a6f24279d55b5989681@news.php.net>, news@flish.co.uk
says...
>
> I have no problem getting a single dimension array back from the form,
> but 2D array's don't work, any ideas?
Ok, not to worry, I still can't find a way to get multi-dimensional
arrays from a form, but I resolved it by creating dynamic single
dimension arrays; ie
group_text[]=
offer_line0[]=
offer_line1[]=
Then when processing the form it's done by;
for ($i=0; $i<count($group_text); $i++)
{
echo $group_text[$i]."<br><br>";
for ($j=0; $j<count(${'offer_line'.$i}); $j++)
{
echo ${'offer_line'.$i}[$j]."<br>";
}
}
Feels messy, but does work, hopefully this will help someone else ;-)
--
Andy Flisher
'All postings are a reflection of my state of mind,
and not necessarily of any worthwhile opinion'
news@flish.co.uk http://www.flish.co.uk