We help IT Professionals succeed at work.

PHP:  how to execute a string as a line of PHP code

willsherwood
willsherwood asked
on
Example:  
$CodeString = "$A = 1";

How can i "execute"     $CodeString     by calling some function with it as a parameter?

Note:  This is NOT a shell command, just simple PHP code.
Comment
Watch Question

CERTIFIED EXPERT
Expert of the Year 2008
Top Expert 2008
Commented:
eval($CodeString);

http://us2.php.net/eval

Author

Commented:
thanks!

Explore More ContentExplore courses, solutions, and other research materials related to this topic.