Menu
Hello. How can I convert content of a one line string into a code, that actually executes? Lets say that I intend to run the following code:
[code]
<?php
$sum=0;
for($i=1;$i<11;$i++){
$sum+=$i;
}
echo $sum;
?>
but part of the code is a content of a string $s:
[code]
<?php
$sum=0;
$s=”for($i=1;$i<11;$i++){“;
//what to write here to use the content of the string $s as a code
$sum+=$i;
}
echo $sum;
?>
Thank you.