Re: Re: Execute statements from a string???

From: Date: Tue, 22 Oct 2002 13:05:09 +0000
Subject: Re: Re: Execute statements from a string???
References: 1 2  Groups: php.general 
Request: Send a blank email to php-general+get-120894@lists.php.net to get a copy of this message
"Shawn McKenzie" <nospam@mckenzies.net> wrote... : > Very cool! Thanks! Also VERY DANGEROUS. Be extra-careful using eval() with user-data, one can gain full access to your server. -- Maxim Maletsky maxim@php.net www.PHPBeginner.com // where PHP Begins > "Jome" <jome@emoj.net> wrote in message > news:20021022050344.98163.qmail@pb1.pair.com... > > > How can I execute a php statement/series of statements that are stored > in > > a > > > string??? > > > > > > Example: > > > > > > $string = "if($a == $b) { echo 'a = b'; }"; > > > > > > Now I want to execute the statement if($a == $b) { echo 'a = b'; } > > > > > > How can I do that with the string??? > > > > http://www.php.net/manual/en/function.eval.php > > > > eval($string); > > > > Jome

« previous php.general (#120894) next »