Drezard Posted June 18, 2007 Share Posted June 18, 2007 Okay, so I want to set PHP inside a variable. So something like: $code = "<?php echo 'my site'; ?>"; but that doesn't seem to work. What can I do to put a php code inside a variable? Regards, Daniel Link to comment https://forums.phpfreaks.com/topic/56019-php-inside-a-variable/ Share on other sites More sharing options...
Grego Posted June 18, 2007 Share Posted June 18, 2007 ...that should work. What "doesn't work" about it? Does it bring up an error message? Link to comment https://forums.phpfreaks.com/topic/56019-php-inside-a-variable/#findComment-276665 Share on other sites More sharing options...
ToonMariner Posted June 18, 2007 Share Posted June 18, 2007 you don't need the <?php tags to do this. have a look at eval - http://uk3.php.net/manual/en/function.eval.php Link to comment https://forums.phpfreaks.com/topic/56019-php-inside-a-variable/#findComment-276666 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.