Re: Array questions...
| From: | Robert Cummings | Date: | Wed, 05 Mar 2008 16:01:04 +0000 |
| Subject: | Re: Array questions... | ||
| References: | 1 2 3 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-271028@lists.php.net to get a copy of this message | ||
On Wed, 2008-03-05 at 10:53 -0500, Jason Pruim wrote:
> On Mar 5, 2008, at 10:35 AM, Robert Cummings wrote:
> >
> > I think you want the following after performing a very cursory look at
> > your sample.
> >
> > <?php
> >
> > $NumArray
> > = isset( $_POST['txtNumArray'] )
> > ? $_POST['txtNumArray']
> > : array();
> >
> > ?>
>
> Mind if I ask why setting it that way would be bettter? Other then the
> fact that it looks like it might possibly handle some of the errors
> I'm getting right now because I don't have the arrays defined before
> this?
>
> Or did I just answer my own question?
It ensures you have an array in the event nothing was posted. I never
just assume that I received data I was supposed to receive.
Cheers,
Rob.
--
http://www.interjinn.com
Application and Templating Framework for PHP