Re[3]: [PHP-WIN] Newbie : Help with check boxes
| From: | Gonzalo Vera | Date: | Wed, 27 Dec 2000 18:44:25 +0000 |
| Subject: | Re[3]: [PHP-WIN] Newbie : Help with check boxes | ||
| References: | 1 2 3 | Groups: | php.windows |
| Request: | Send a blank email to php-windows+get-4682@lists.php.net to get a copy of this message | ||
> About all you can do is check each var that should be .. so if you
> have 5 boxes you could
> if (isset($box1)) { }
> if (isset($box2)) { }
> if (isset($box3)) { }
> if (isset($box4)) { }
> This really does turn out to be the simplest depending on how nested
> your logic becomes between the boxs.
It can be a little simpler if you have many boxes, using PHP's
"variable variables", like:
for ($c=1; $c<=$numboxes; $c++) {
$varvar="box$c";
if ($$varvar) { }
}
This is if you know how many boxes (numboxes) you had, to start with.
If you don't, use a while instead.
This way you can effectively handle parameters array-like.
Regards,
Gonzalo.