runtime - How to execute PHP commands dynamically at run time? -


i wonder there way let's dynamically load piece of code @ run time? instance have simple "switch...case" statement this:

switch($choice) {    case 'help':       load_from_db('help');       break;    case 'about':       load_from_db('about');       break; } 

and have database:

| keyword | command                          |        require('help.php');       echo 'under construction.'; 

"load_from_db" function capable of reading db (we know how this) , execute corresponding command stored in database (my question part).

another example simple "textarea" form user can write php code within , submit form. @ server side code executed , result wil shown user (i know not safe, example).

any ideas?

you can use, should avoid, http://de.php.net/eval


Comments

Popular posts from this blog

c# - SelectList with Dictionary, add values to the Dictionary after it's assigned to SelectList -

how can i manage url using .htaccess in php? -

ios - I get the error Property '...' not found on object of type '...' -