I tried that and strangely it didn't work and using eval() was really my
only solution :(
People told me to od $foo[$bar], $foo['$bar'], $foo["$bar"], $foo[($bar)],
and the manual doesn't seem to mind $foo[$bar], but I dunno. It just wasn't
working, and I was angry and depressed that I wasn't getting paid enough for
what I was doing so I took the easy way out. It's the only time I ever used
eval() in PHP.

> -----Original Message-----
> From: Rasmus Lerdorf [mailto:[EMAIL PROTECTED]]
> Sent: January 20, 2002 11:22 PM
> To: Alex Dowgailenko
> Cc: [EMAIL PROTECTED]
> Subject: RE: [PHP] Re: eval()
>
>
> >     while (list($opid, $ppid, $amount, $pname) =
> mysql_fetch_row($res)) {
> >             $eval = '$temp["'.$pname.'"] = $temp["'.$pname.'"]
> + '.$amount.';';
> >             eval($eval);
> >             $i++;
>
> Whoa...  Why not simply:
>
> $temp[$pname] += $amount;
>
> ??
>
> -Rasmus
>
>


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