tdobrotka Posted April 1, 2007 Share Posted April 1, 2007 Helo Everybody, I would like to ask this. Is there some function that will parse PHP code and then execute it? I would like to use it for including of dynamic content stored in 'string'. For example (I named the function execute_php_code(); ): <? $some_php_code="<?echo('Hello world!');?>"; execute_php_code($some_php_code); ?> Is there some default function that is actling like that? Thanks Tomas Link to comment https://forums.phpfreaks.com/topic/45122-my-last-open-question-about-php-for-past-6-years/ Share on other sites More sharing options...
shocker-z Posted April 1, 2007 Share Posted April 1, 2007 I believe if your trying to run it from a console instead of web server you would use the normal PHP command line inside an exec() what are you trying to achieve fully? regards Liam Link to comment https://forums.phpfreaks.com/topic/45122-my-last-open-question-about-php-for-past-6-years/#findComment-219053 Share on other sites More sharing options...
Barand Posted April 1, 2007 Share Posted April 1, 2007 <?php $some_php_code="echo('Hello world!');"; eval($some_php_code); ?> BEWARE of using eval where the string being evaluated comes from an external source! Link to comment https://forums.phpfreaks.com/topic/45122-my-last-open-question-about-php-for-past-6-years/#findComment-219097 Share on other sites More sharing options...
tdobrotka Posted April 1, 2007 Author Share Posted April 1, 2007 Thank you Link to comment https://forums.phpfreaks.com/topic/45122-my-last-open-question-about-php-for-past-6-years/#findComment-219189 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.