RE: [PHP] Re: Avoiding NOTICEs on Array References
| From: | Michael Sims | Date: | Thu, 27 Jan 2005 12:31:36 +0000 |
| Subject: | RE: [PHP] Re: Avoiding NOTICEs on Array References | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-207468@lists.php.net to get a copy of this message | ||
Jochem Maas wrote:
> Michael Sims wrote:
>> On a "controller" page (the C in MVC) that handles form submissions
>> I create an array which defines what form variables are available
>> and their default values if not entered. I then use array_merge()
>> to combine that array with $_POST (or $_GET, as the case may be) and
[...]
> Its a good idea - although to make this example work I believe you
> would need to use array_merge_recursive() - which does what you mean
> ;-)
Yup, good catch. :) Since I started using this method I haven't actually
had a form with more than one dimension of variables like that. Now if I do
I'll be saved a bit of troubleshooting; thanks. :)