Dat Posted May 14, 2008 Share Posted May 14, 2008 How can I execute php coding in a string. Because once I replace all variable within my template the string will contain: "<?php if($something) { echo $this; } ?> So after replacing all variables with values how can I execute the php codes in the string before printing the final result? Is there a php function for this, because i seem to find it on the php site. Link to comment https://forums.phpfreaks.com/topic/105541-solved-code-execute-from-string/ Share on other sites More sharing options...
p2grace Posted May 14, 2008 Share Posted May 14, 2008 eval() should do the trick http://www.php.net/manual/en/function.eval.php Link to comment https://forums.phpfreaks.com/topic/105541-solved-code-execute-from-string/#findComment-540643 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.