Re: Array questions...

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux