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
Wojciech Jamrozy blogBlog about computer science, programming and linux
|
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 comments so far...
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?
leave a reply