Re: [PHP] Creating variable names from values

2007-03-12 Thread Richard Lynch
On Thu, March 8, 2007 11:56 am, Otto Wyss wrote: From an arry I create a table like foreach ($persons as $key = $pers) { echo tdinput name=\K$key\ type=\checkbox\ .../td td.../td } so each checkbox field has its own name created from $key. Yet how can I access

Re: [PHP] Creating variable names from values

2007-03-12 Thread Robert Cummings
On Mon, 2007-03-12 at 19:30 -0500, Richard Lynch wrote: On Thu, March 8, 2007 11:56 am, Otto Wyss wrote: From an arry I create a table like foreach ($persons as $key = $pers) { echo tdinput name=\K$key\ type=\checkbox\ .../td td.../td } so each checkbox

Re: [PHP] Creating variable names from values

2007-03-12 Thread Richard Lynch
On Mon, March 12, 2007 7:57 pm, Robert Cummings wrote: On Mon, 2007-03-12 at 19:30 -0500, Richard Lynch wrote: On Thu, March 8, 2007 11:56 am, Otto Wyss wrote: From an arry I create a table like foreach ($persons as $key = $pers) { echo tdinput name=\K$key\ type=\checkbox\

[PHP] Creating variable names from values

2007-03-08 Thread Otto Wyss
From an arry I create a table like foreach ($persons as $key = $pers) { echo tdinput name=\K$key\ type=\checkbox\ .../td 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 =

Re: [PHP] Creating variable names from values

2007-03-08 Thread Rabih Tayyem
Actuallyyou're doing it rightyou just need to concatenate. ex: echo tdinput *name=\K.$key.\* type=\checkbox\ .../td and then later you access the values the same way...(you loop on $key and the value would be K.$key)... Regards, Rabih On 3/8/07, Otto Wyss [EMAIL PROTECTED] wrote:

Re: [PHP] Creating variable names from values

2007-03-08 Thread Satyam
- Original Message - From: Otto Wyss [EMAIL PROTECTED] To: php-general@lists.php.net Sent: Thursday, March 08, 2007 5:56 PM Subject: [PHP] Creating variable names from values From an arry I create a table like foreach ($persons as $key = $pers) { echo tdinput name=\K$key

Re: [PHP] Creating variable names from values

2007-03-08 Thread David Giragosian
On 3/8/07, Otto Wyss [EMAIL PROTECTED] wrote: Satyam wrote: $key = 'K' . $key; if ($$key) { notice double dollar sign, it means, not the value of $key but the value of the variable $key says. Thanks, any idea where this is described in the PHP manual? Searching for $$ produces no

Re: [PHP] Creating variable names from values

2007-03-08 Thread Satyam
[EMAIL PROTECTED] To: php-general@lists.php.net Sent: Thursday, March 08, 2007 8:16 PM Subject: Re: [PHP] Creating variable names from values Satyam wrote: $key = 'K' . $key; if ($$key) { notice double dollar sign, it means, not the value of $key but the value of the variable $key says

Re: [PHP] Creating variable names from values

2007-03-08 Thread Jim Lucas
Otto Wyss wrote: From an arry I create a table like foreach ($persons as $key = $pers) { echo tdinput name=\K$key\ type=\checkbox\ .../td Maybe this? ... type=\K[{$key}]\ ... td.../td } so each checkbox field has its own name created from $key. Yet how can I access