On Thu, 2002-01-31 at 23:37, jtjohnston wrote:
> Niklas,
> Bingo. I wondered if it was somehting like that? Same thing in JS more or
> less.
> Thanks,
> John
eval() will work here, but it's overkill--it's a very expensive
operation. You should avoid it whenever you can. A better way is to put
eve
* hugh danaher ([EMAIL PROTECTED]) [Feb 01. 2002 03:44]:
> I learned it as: echo ${"check".$i};
Works the same way. If you want to get really picky:
echo ${'check'.${i}};
> and then was told to use an array...
> as in:
> echo $check[$i];
The circumstances must have been different. As of php 4
I learned it as:
echo ${"check".$i};
and then was told to use an array...
as in:
echo $check[$i];
hugh
- Original Message -
From: "Brian Clark" <[EMAIL PROTECTED]>
To: "PHP is not a drug." <[EMAIL PROTECTED]>
Sent: Thursday, January 31,
* Brian Clark ([EMAIL PROTECTED]) [Feb 01. 2002 02:37]:
[...]
> echo ${"Check$i"}
Whoops. Make that:
echo ${"Check$i"};
--
Brian Clark | Avoiding the general public since 1805!
Fingerprint: 07CE FA37 8DF6 A109 8119 076B B5A2 E5FB E4D0 C7C8
It may be your sole purpose in life to serve as a wa
* jtjohnston ([EMAIL PROTECTED]) [Feb 01. 2002 02:14]:
> Anyone Awake? Up?
Yawwwnn. :-)
[...]
> When I submit, I want to echo to see if anyone clicked on them. But I
> can't get my variable right to find $check1 through $check12. How do I
> express in a for loop. $Check.$i does not work of cou
Niklas,
Bingo. I wondered if it was somehting like that? Same thing in JS more or
less.
Thanks,
John
> eval() is your solution.
>
> for ($i = 1; $i <= $NMax; $i++)
> {
> $variable = "\$Check$i";
> eval("\$string = \"$variable\";");
> echo $string."";
> }
>
> Niklas
>
> ---
eval() is your solution.
for ($i = 1; $i <= $NMax; $i++)
{
$variable = "\$Check$i";
eval("\$string = \"$variable\";");
echo $string."";
}
Niklas
-Original Message-
From: jtjohnston [mailto:[EMAIL PROTECTED]]
Sent: 1. helmikuuta 2002 9:16
To: [EMAIL PROTECTED]
7 matches
Mail list logo