> -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
2 matches
Mail list logo