Re: Can PHP execute a string containing PHP code?

From: Date: Fri, 09 May 2008 18:15:17 +0000
Subject: Re: Can PHP execute a string containing PHP code?
References: 1  Groups: php.evangelism 
Request: Send a blank email to php-evangelism+get-478@lists.php.net to get a copy of this message
$toEval = "\$y = 5 * 6; "; eval($toEval); echo $y; //will output 30 On May 9, 2008, at 7:41 PM, jim wrote:
Hi, Can anyone tell me how to use PHP to execute a string that contains PHP code which contains references to objects and variables such that when the string (code) is executed the objects and/or variables are updated (from the perspective of the calling program)? I am in the process of determining if PHP is the appropriate scripting language for an application that I am writing. Thanks in advance. Jim
Bojan Tesanovic http://www.carster.us/

« previous php.evangelism (#478) next »