Re: Creating variable names from values
| From: | Jim Lucas | Date: | Thu, 08 Mar 2007 22:13:25 +0000 |
| Subject: | Re: Creating variable names from values | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-250130@lists.php.net to get a copy of this message | ||
Otto Wyss wrote:
From an arry I create a table like foreach ($persons as $key => $pers) {Maybe this? ... type=\"K[{$key}]\" ...echo "<td><input name=\"K$key\" type=\"checkbox\" ...></td>
how OR where are you wanting to access this information from?<td>...</td>} so each checkbox field has its own name created from $key. Yet how can I access these fields (names) later on?
foreach ($persons as $key => $pers) {
if ($K???) {
$cnt += 1; ...
}
}
Is there a better way to access multiple fields from a table?
O. Wyss
--
Enjoy,
Jim Lucas
Different eyes see different things. Different hearts beat on different
strings. But there are times for you and me when all such things agree.
- Rush