Re: Re: Variable name as a string
| From: | ioannes | Date: | Wed, 27 Aug 2008 18:08:18 +0000 |
| Subject: | Re: Re: Variable name as a string | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-278808@lists.php.net to get a copy of this message | ||
Yes, 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