and that's pretty cool ... do you also have a solution
to access the name of this "dynamic" variable if I'd
like to use it also (e.g. with WDDX functions)? That' would 
be great!

TIA, Arne

> -----Original Message-----
> From: ..s.c.o.t.t.. [gts] [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, May 10, 2001 5:07 PM
> To: Php-General
> Subject: RE: [PHP] if $index=1 how can I create a variable named
> $column_1
> 
> 
> And even though it's much less elegant than the
> solution by Sean below, you could also use 'eval'
> 
>  $toast = array("wheat", "rye", "pumpernickel");
>  $numbreads = count($toast);
>  for ($index = 0; $index < $numbreads; $index++) {
>       eval("\$column$index = '$toast[$index]';
>               echo \$column$index . '<BR>';") ;
>  }
> 
> > -----Original Message-----
> > From: Sean R. Bright [mailto:[EMAIL PROTECTED]]
> > To: 'Jay Lepore'; [EMAIL PROTECTED]
> > Subject: RE: [PHP] if $index=1 how can I create a variable named
> > 
> > $toast = array("wheat", "rye", "pumpernickel");
> > $numbreads = count($toast);
> > for ($index = 0; $index < $numbreads; $index++) {
> >     ${"column" . $index} = $toasts[$index];
> > }
> > 
> > (A little less code and one less variable required.)
> > 
> > Sean
> 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to