Re: Re: Variable name as a string
| From: | Shawn McKenzie | Date: | Wed, 27 Aug 2008 18:58:44 +0000 |
| Subject: | Re: Re: Variable name as a string | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-278825@lists.php.net to get a copy of this message | ||
ioannes wrote:
Actually, you are right, as you just put the checkbox index in the POST and get the value from there. So you just need the number of checkboxes...sorry. ioannes wrote:Either I'm missing what you're trying to do, or this has become incredibly over complicated! -ShawnYes, Tedd, this does however incur the overhead of find out what i is, because it could be a range of IDs from the database, not necessarily a count of the checkboxes on the page: " for ($i = 1; $i <= 4; $i++) { $a = 'a' . $i; $b = 'whatever' . $i; if($_POST[$a] == 'on'){ my_array[] = $_POST[$b] }} " John