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 " >> >... >> >

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 " > >... > >} > > > > so each checkbox field has its own name created fro

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 " >... >} > > so each checkbox field has its own name created from $key. Yet how can > I > access these fields (names) later on? > >for

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 " Maybe this? ... type=\"K[{$key}]\" ... ... } so each checkbox field has its own name created from $key. Yet how can I access these fields (names) later on? how OR where ar

Re: [PHP] Creating variable names from values

2007-03-08 Thread Satyam
rom: "Otto Wyss" <[EMAIL PROTECTED]> To: 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 th

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 "$$" pr

Re: [PHP] Creating variable names from values

2007-03-08 Thread Otto Wyss
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 results. O. Wyss -- PHP General Mailing List

Re: [PHP] Creating variable names from values

2007-03-08 Thread Satyam
- Original Message - From: "Otto Wyss" <[EMAIL PROTECTED]> To: 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 " ... }

Re: [PHP] Creating variable names from values

2007-03-08 Thread Rabih Tayyem
Actuallyyou're doing it rightyou just need to concatenate. ex: echo " 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: From an arry I create a table like fore

[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 " ... } 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; ...