RE: [PHP] Re: eval()

From: Date: Mon, 21 Jan 2002 04:30:41 +0000
Subject: RE: [PHP] Re: eval()
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-81321@lists.php.net to get a copy of this message
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:rasmus@lerdorf.ca] > Sent: January 20, 2002 11:22 PM > To: Alex Dowgailenko > Cc: php-general@lists.php.net > 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 > >

« previous php.general (#81321) next »