> -Original Message-
> From: Phillip S. Baker [mailto:[EMAIL PROTECTED]]
> Sent: 07 March 2002 05:52
>
> for ($i=1; $i < 12; $i++) {
> echo state_$i; // This would print out either Yes No or Maybe.
> }
Close -- it's actually:
echo ${"state_$i"};
(For the record, these
> for ($i=1; $i < 12; $i++) {
> echo state_$i; // This would print out either Yes No or Maybe.
> }
What you actually want is:
for ($i=1; $i < 12; $i++)
{
$mystate = "state_".$i;
echo $$mystate; // This would print out either Yes No or Maybe.
}
$$X tells PPH to use
I am not sure I can articulate this well.
But I will try.
I want to combine either two variables or a variable and string to bring up
the name of a previous variable name to display the data from the first.
So in the first part I will have a listing that will look like
// Submit etc
3 matches
Mail list logo