Re: Differences in arrays

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

 



> 1-I guess I need a way to make sure in the foreach
> that when the first empty element is reached the loop
> dies.

Just to be sure you understand:

You should really not die when you hit a blank.

You should just SKIP it and process the rest.

A user *might* choose to fill in the first and third text box INPUTs, and
#2 would be blank.  But they'd (rightly) expect you to process #3.

> 2- Why would the second array behave differently then
> the first ?

It's not you.

It's the way HTTP protocol was set up, not really planning for complicated
forms with arrays and such-like.

PHP using arrays (and other languages doing what they do) are mostly
work-arounds of the short-comings of the HTTP protocol.

It would be nice if the HTTP protocol had planned this out a bit better,
and INPUT, SELECT MUTIPLE, CHECKBOX, and RADIO all behaved in a more
rational/similar manner.

OTOH, if you make them too much the same, you'd probably end up having to
do more work for the simple forms.  So it goes.

-- 
Like Music?
http://l-i-e.com/artists.htm

-- 
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