View Full Version : Executing some code

11-05-2003, 03:58 AM
Hello, I'm fairly new to php and am looking for the correct way to execute some code that is contained in a variable.

For example, say $myVar contains the string "<?php echo("I am ". 2003-1980 ."years old."); ?>" How can I execute the that string?


11-05-2003, 11:14 PM
You need www.php.net/eval, but I'm not so sure if you have to strip the processing instructions ("<?php" and "?>") before applying eval() to your code.

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum