Re[4]: [PHP-WIN] Newbie : Help with check boxes
| From: | David Tod Sigafoos | Date: | Wed, 27 Dec 2000 19:05:52 +0000 |
| Subject: | Re[4]: [PHP-WIN] Newbie : Help with check boxes | ||
| References: | 1 2 3 4 | Groups: | php.windows |
| Request: | Send a blank email to php-windows+get-4683@lists.php.net to get a copy of this message | ||
GV> It can be a little simpler if you have many boxes, using PHP's
GV> "variable variables", like:
GV> for ($c=1; $c<=$numboxes; $c++) {
GV> $varvar="box$c";
GV> if ($$varvar) { }
GV> }
GV> This is if you know how many boxes (numboxes) you had, to start with.
GV> If you don't, use a while instead.
GV> This way you can effectively handle parameters array-like.
You are of course right. But i limit the use of this to those
instances where there are more than a half dozen or so. I don't mind
typing and the 'readability/maintainability' factors is very important
to me.
Also .. Normally I use real names for boxes so something like this
would not work (but I could/sometimes do store the names in an array
and parse them out).
--
DSig
David Tod Sigafoos
mailto:dsig@teleport.com
Using 'The Bat' 1.48f
`````
( O O )
_______oOOo__( )__oOOo_______