Re: HELP!! how can arithmetic variables(string) ??

From: Date: Thu, 18 Oct 2007 12:38:14 +0000
Subject: Re: HELP!! how can arithmetic variables(string) ??
References: 1 2  Groups: php.general 
Request: Send a blank email to php-general+get-263301@lists.php.net to get a copy of this message
Thank You ! "Colin Guthrie" <gmane@colin.guthr.ie> ¼¶¼g©ó¶l¥ó·s»D:ff76fg$ii3$1@ger.gmane.org... > LKSunny wrote: >> <? >> $a="1+1"; //variables(string) >> >> //how can arithmetic variables(string) ?? >> //N ROW................ >> >> //output >> echo $a //i need output "2" not "1+1" >> //Please Help, Thank You Very Much !! >> ?> >> > > You can do: > > eval("echo $a;"); > > But be warned, this has "Injection Attack" written all over it! > > Col

« previous php.general (#263301) next »