[PHP] Execution/evaluation of code from variable
In PHP we can use function eval in order to evaluate given variable (string) as PHP code:
<? $var = 'for ($i=0;$i<5;$i++) { echo $i.\'<br>\'; }'; eval($var); ?> |
output:
0 1 2 3 4 |
In PHP we can use function eval in order to evaluate given variable (string) as PHP code:
<? $var = 'for ($i=0;$i<5;$i++) { echo $i.\'<br>\'; }'; eval($var); ?> |
output:
0 1 2 3 4 |
3 thoughts on “[PHP] Execution/evaluation of code from variable”
Hello webmaster,
I would like to share with you a link, write to alarroste@mail.ru
Hello webmaster
I would like to share with you a link to your site
write me here preonrelt@mail.ru
Hello. I think the article is really interesting. I am even interested in reading more. How soon will you update your blog?