How can I call a PHP function stored as a string from within another PHP function? -


i find myself in situation need call php function stored string php function.

<?php $phpcodestring = "<?php echo 'hello world!' ?>"; echo $phpcodestring; ?> 

how can hello world render screen above structure?

back few steps - why need that?

99.9% of time there better way eval().

or use create_function() internally uses eval() isn't better, when not defining function body directly string literal can sure there , there nothing potentially dangerous.


Comments

Popular posts from this blog

android - Spacing between the stars of a rating bar? -

aspxgridview - Devexpress grid - header filter does not work if column is initially hidden -

c# - How to execute a particular part of code asynchronously in a class -